I also used COBOL as main language for several years.
It's not bad at all.
I have no objection against it.
It's just a lot to type to get something done.
That's all.
I also used COBOL as main language for several years.
Code: Select all
LD A,3
OUT (231),A
RET
Code: Select all
3E 03 D3 E7 C9
Code: Select all
10 POKE 16514,62
20 POKE 16515,3
30 POKE 16516,211
40 POKE 16517,231
50 POKE 16518,201
Looking at this from machine code, the same thing happens. That is the USR 16514 part. So here machine code at address 16514 is run, and when routine is exited with RET, the content of the BC register is returned to Basic.
The REM statement just reserves some bytes in memory, that can be overwritten by the POKEs. If we don't have the REM statement, our Basic program gets overwritten and corrupted. If you see chapter 27 of the manual Sinclair ZX81 Basic Programming we have these addresses:
Code: Select all
16509 Start of program. It starts with the first line number and takes 2 bytes.
16511 Contains the length of the first line and takes 2 bytes.
16513 Contains the first byte of the Basic program: In this case value 234 which is the keyword REM (see Appendix A)
16514 Is the first byte after the REM statement, and here we have poked in our program.
What means "the pokes would overwrite the content of line 10" ?the pokes would overwrite the content of line 10
??Hence the actual value returned is irrelevant.
Code: Select all
Machine code has to live somewhere.
That's right.