Linguaggio macchina VIC20

Deutsch, Italiano, Nederlands, Norsk, Polski, Suomi, Svenska, all non-English discussions

Moderator: Moderators

fraural
Vic 20 Drifter
Posts: 27
Joined: Sat Oct 02, 2021 1:28 am
Location: Trento, Italy

Re: Linguaggio macchina VIC20

Post by fraural »

Dear friends, I proudly announce that I have finished my first complete machine language program. Completely self-taught. This announcement will not interest anyone, but I am happy with my work.
Thank you all.
Francesco
User avatar
orion70
VICtalian
Posts: 4341
Joined: Thu Feb 02, 2006 4:45 am
Location: Piacenza, Italy
Occupation: Biologist

Re: Linguaggio macchina VIC20

Post by orion70 »

It is not of interest in fact, it's of the greatest interest. Always happy to read about a new Denialer friend who has learned ML, to the point that he wrote a program :D

Warmest congratulations for it, can't wait to see your creature. Ad maiora!
fraural
Vic 20 Drifter
Posts: 27
Joined: Sat Oct 02, 2021 1:28 am
Location: Trento, Italy

Re: Linguaggio macchina VIC20

Post by fraural »

Caro amico grazie dell'entusiasmo! ma dubito davvero che interessi a qualcuno... Ho scritto lo stesso programma in Basic in pochi giorni, ma ci ho messo mesi e mesi per l'equivalente in linguaggio macchina. Non certo un risultato notevole... ma quello che mi dà soddisfazione è essere riuscito senza importunare nessuno qui (a parte qualche tempo fa per avere qualche spintarella).
Ancora ti ringrazio per il tuo supporto :)
Ad maiora certo... aggiungerei anche per aspera ;)
DarwinNE
Vic 20 Devotee
Posts: 231
Joined: Tue Sep 04, 2018 2:40 am
Website: http://davbucci.chez-alice.fr
Location: Grenoble - France

Re: Linguaggio macchina VIC20

Post by DarwinNE »

Complimenti da parte mia!!! Mi ricordo molto bene cos'è stato per la prima volta scrivere una corta routinetta in LM, usando un monitor chiamato Zoom sul C64. Non è stato un passo semplice da fare.
User avatar
Mike
Herr VC
Posts: 4841
Joined: Wed Dec 01, 2004 1:57 pm
Location: Munich, Germany
Occupation: electrical engineer

Re: Linguaggio macchina VIC20

Post by Mike »

Sarebbe molto interessante vedere sia il programma originale che la traduzione in linguaggio macchina. Sebbene ci sia voluto del tempo per compiere questa impresa, può servire da incoraggiamento per altre persone. Il tuo esempio mostra che la perseveranza è la cosa più importante nello sviluppo delle abilità.
fraural
Vic 20 Drifter
Posts: 27
Joined: Sat Oct 02, 2021 1:28 am
Location: Trento, Italy

Re: Linguaggio macchina VIC20

Post by fraural »

Mike wrote: Wed Jan 26, 2022 10:41 am Sarebbe molto interessante vedere sia il programma originale che la traduzione in linguaggio macchina
Sono molto contento del tuo commento Mike. Sarebbe utilissimo per me avere delle critiche per il miglioramento, ma mi vergogno moltissimo a far vedere il mio lavoro... è lungo, prolisso e inefficiente. E non voglio far perdere tempo a nessuno. Comunque, niente di segreto, è un semplice Mastermind a quattro posizioni. Qualcosa che voi in due giorni riuscite a scrivere :)
DarwinNE wrote: Wed Jan 26, 2022 6:26 am usando un monitor chiamato Zoom sul C64
Grazie Darwin! Ho utilizzato Vicmon per un po', poi sono passato a Hesmon. Alla fine mi sono arreso per la complessità di gestione e sono passato sul pc utilizzando Notepad e il bellissimo sito di Norbert Landsteiner "Mass:werk" che fornisce uno splendido assembler/disassembler online. Il risultato poi lo utilizzo sul nuovo "The VIC20"... il giocattolo che mi ha riportato all'infanzia ;)
User avatar
chysn
Vic 20 Scientist
Posts: 1205
Joined: Tue Oct 22, 2019 12:36 pm
Website: http://www.beigemaze.com
Location: Michigan, USA
Occupation: Software Dev Manager

Re: Linguaggio macchina VIC20

Post by chysn »

fraural wrote: Tue Jan 25, 2022 1:15 pm Dear friends, I proudly announce that I have finished my first complete machine language program. Completely self-taught. This announcement will not interest anyone, but I am happy with my work.
That's great to hear, it's fun, isn't it?
fraural
Vic 20 Drifter
Posts: 27
Joined: Sat Oct 02, 2021 1:28 am
Location: Trento, Italy

Re: Linguaggio macchina VIC20

Post by fraural »

chysn wrote: Thu Jan 27, 2022 1:36 pm That's great to hear, it's fun, isn't it?
Oh yes, YES!!! Exciting! I'm 53. But I'm feel as a child :)
Mike wrote: Wed Jan 26, 2022 10:41 am Sarebbe molto interessante vedere sia il programma originale che la traduzione in linguaggio macchina.
See attachs: a zipped file with my original written in BASIC, and a quite different version in ML (with 2-pass listing).
BASIC version is not important for me. The hard work is for assembly version :)
Please don't be too bad in your judgment :)
Attachments
mmml-fraural.zip
For testing purposes
(25.94 KiB) Downloaded 128 times
User avatar
chysn
Vic 20 Scientist
Posts: 1205
Joined: Tue Oct 22, 2019 12:36 pm
Website: http://www.beigemaze.com
Location: Michigan, USA
Occupation: Software Dev Manager

Re: Linguaggio macchina VIC20

Post by chysn »

It's like Wordle, but with numbers! :D

I keep getting it in 6 guesses, and that's my record.
Please don't be too bad in your judgment
You can't judge something too harshly if it works! You can start learning techniques to be more efficient (with memory and cycles) a little at a time. It depends on what your priorities are. One simple technique: don't be afraid of inlining your code. If you're only using a subroutine once (like most of the stuff in START, RESTART, MAINLOOP) it saves both bytes and cycles to just move that subroutine code right to the main process. When you program in other languages, this can seem strange. And I don't always heed this advice myself, because old C habits can prevail. But it's a good place to start.

Nice job!
User avatar
chysn
Vic 20 Scientist
Posts: 1205
Joined: Tue Oct 22, 2019 12:36 pm
Website: http://www.beigemaze.com
Location: Michigan, USA
Occupation: Software Dev Manager

Re: Linguaggio macchina VIC20

Post by chysn »

Screen Shot 2022-01-28 at 9.20.30 AM.png
One suggestion I have is to use a third character (like X) when the number is a miss. Otherwise, it's hard to tell (especially in early games) which position the output refers to.

I'm getting it in 3 or 4 almost every game now, with the occasional 5.
fraural
Vic 20 Drifter
Posts: 27
Joined: Sat Oct 02, 2021 1:28 am
Location: Trento, Italy

Re: Linguaggio macchina VIC20

Post by fraural »

chysn wrote: Thu Jan 27, 2022 2:50 pm One simple technique: don't be afraid of inlining your code.
(...)
And I don't always heed this advice myself, because old C habits can prevail. But it's a good place to start.
Nice job!
Thank you a lot! So: unreadable but more efficient code :D
chysn wrote: Fri Jan 28, 2022 8:21 am One suggestion I have is to use a third character (like X)
Yes, it had occurred to me too.
Thanks for wasting your time with this exercise ;)
fraural
Vic 20 Drifter
Posts: 27
Joined: Sat Oct 02, 2021 1:28 am
Location: Trento, Italy

Re: Linguaggio macchina VIC20

Post by fraural »

Sembra che io sia scarno nel restituire un feedback agli interventi ricevuti, ma in realtà il mio limite è la lingua inglese, che non conosco, e passare sempre dal traduttore è davvero frustrante.
In realtà sono super felice di aver ricevuto dei riscontri su una cosa, tutto sommato, molto banale.
Adesso vorrei imparare a realizzare qualcosa magari con la grafica, e continuare a studiare tecniche per gli algoritmi più frequenti (ad esempio, quello per la generazione dei numeri casuali mi ha portato via tanto tempo, come pure l'algoritmo per la stampa di un singolo carattere o di una stringa di testo).
E poi devo imparare a manipolare meglio i testi senza dover pre-costruirli in apposite tavole immutabili come ho fatto in questo esercizio.
Insomma credo che scriverò ancora ;)
Nel frattempo grazie a tutti voi (e al regolamento del forum che permette di scrivere in italiano senza infrangere le regole).
Post Reply