Page 2 of 2

Re: Linguaggio macchina VIC20

Posted: Tue Jan 25, 2022 1:15 pm
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

Re: Linguaggio macchina VIC20

Posted: Tue Jan 25, 2022 2:52 pm
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!

Re: Linguaggio macchina VIC20

Posted: Wed Jan 26, 2022 5:51 am
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 ;)

Re: Linguaggio macchina VIC20

Posted: Wed Jan 26, 2022 6:26 am
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.

Re: Linguaggio macchina VIC20

Posted: Wed Jan 26, 2022 10:41 am
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à.

Re: Linguaggio macchina VIC20

Posted: Wed Jan 26, 2022 11:29 am
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 ;)

Re: Linguaggio macchina VIC20

Posted: Thu Jan 27, 2022 1:36 pm
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?

Re: Linguaggio macchina VIC20

Posted: Thu Jan 27, 2022 1:59 pm
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 :)

Re: Linguaggio macchina VIC20

Posted: Thu Jan 27, 2022 2:50 pm
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!

Re: Linguaggio macchina VIC20

Posted: Fri Jan 28, 2022 8:21 am
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.

Re: Linguaggio macchina VIC20

Posted: Fri Jan 28, 2022 12:01 pm
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 ;)

Re: Linguaggio macchina VIC20

Posted: Fri Jan 28, 2022 12:05 pm
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).