I did a little bit of refactoring. Now there is a separate macro m_header that you can use to initialise the word header. This can simplify and shorten the code and make it more robust against the errors. Also you would not need to define all those extra link labels (e.g. SCAN_L). .macro m_header name, flags fdw 9b .equ name_len, 2f-1f 9: .byte NFA|\flags|name_len 1: .ascii "\name" 2: .align 1 .endm ; Macros for registers .macro mreg reg, name, flags m_header \name, \flags m_dup ldi tosl,lo8(\reg)...
I have changed the definition of mreg so it does not require the name length parameter. ; Macros for registers .macro mreg reg, name, flags fdw 9b .equ name_len, 2f-1f 9: .byte NFA|\flags|name_len 1: .ascii "\name" 2: .align 1 m_dup ldi tosl,lo8(\reg) ldi tosh,hi8(\reg) ret .endm I have also expanded the port definitions in the registers.inc ; list here the registers you want to include in the FF core dictionary ; The parameters are ; register name, word name, word flags (inline=0x20) mreg PORTB,portb,0...
Is it possible for the assembler to calculate the length of the name? For example length("\name") in the mreg macro. Also, where can I find documentation for the .macro directive?
That was really quick. Thanks! I see you made a macro mreg for simplifying the port definitions. I will play around with it and come back with more questions ;-)
@oh2aun I have managed to successfully compile the hex file. Now, I would like to add some Forth words to the image (e.g. port definitions) -- how do I do that?
@oh2aun I tried compiling the source code myself. The resulting hex file does not enumerate under Windows 10. Any ideas what am I doing wrong?
I can confirm that it now works well with TeraTerm, PuTTY and RealTerm on Windows 10.
Thank you for your effort! I can confirm that the new hex file works. At least I got the command prompt ok<#,ram>, I haven't investigated further yet. Also, it works only in TeraTerm -- it does not work with PuTTY or RealTerm (at least I haven't managed to make it work). PuTTY complains that it cannot connect to COM port saying Unable to open connection to COM13. Unable to configure serial port.