Started learning Machine code: Am i doing this correctly?

Anything Sinclair ZX Basic related; history, development, tips - differences between BASIC on the ZX80 and ZX81
Moggy
Posts: 1909
Joined: Wed Jun 18, 2008 2:00 pm

Re: Started learning Machine code: Am i doing this correctly?

Post by Moggy » Tue Nov 05, 2019 10:07 pm

Some excellent links there. Many thanks Martin and Blittled. :D

Crayon21
Posts: 141
Joined: Sun Nov 04, 2018 2:33 am

Re: Started learning Machine code: Am i doing this correctly?

Post by Crayon21 » Thu Nov 07, 2019 8:31 am

this is driving me nuts. here is the excerpt:

Using the program "HEXLD", enter the following program, by inputting the symbols in the left hand column. Once the whole program has been entered, break out by inputting "S".

2600 LD H,00h
2E2A LD L,2Ah
C9 RET

here's the issue, i type the numeric code but the zx81 goes blank for an eternity requiring a reset.
Do i press enter each time or do i have to enter the numbers one after the other?
please help, this is making me very,very irritated.

Any ideas?

Edit: figured it out, why can't they just swap input with press enter?
zx81: great yet flawed
Zx spectrum: masterpiece that keeps on giving

(wish it weren't so expensive) :o

Shaun_B
Posts: 470
Joined: Wed Apr 22, 2009 10:22 am

Re: Started learning Machine code: Am i doing this correctly?

Post by Shaun_B » Wed Jan 08, 2020 11:09 am

"Started learning Machine code: Am i doing this correctly?"

What would John McCarthy say...?
John McCarthy
John McCarthy
:lol:

In all seriousness I'll read through this thread and pick up some tips!

Good luck!

User avatar
XavSnap
Posts: 821
Joined: Sat May 10, 2008 4:23 pm

Re: Started learning Machine code: Am i doing this correctly?

Post by XavSnap » Thu Jan 09, 2020 1:43 am

Thanks Shaun for this advice!

Crayon21, thanks for this… ASM tutoral.

http://www.users.waitrose.com/~thunor/m ... ter02.html
HexLD.JPG
A RAND USR 30000 give me a 0/0 prompt… (without RAMTOP to clear it by a 'NEW' command)
30000=$7530
Cool !

User avatar
XavSnap
Posts: 821
Joined: Sat May 10, 2008 4:23 pm

Re: Started learning Machine code: Am i doing this correctly?

Post by XavSnap » Thu Jan 09, 2020 2:13 am

:oops:
"26" n/l
"00" n/l
"2E" n/l
"2A" n/l
"C9" n/l
"S" n/l
RAND USR 30000

Not:
"2600" n/l
"2E2A" n/l
"C9" n/l
"S" n/l
RAND USR 30000

User avatar
mrtinb
Posts: 1157
Joined: Fri Nov 06, 2015 5:44 pm
Location: Denmark
Contact:

Re: Started learning Machine code: Am i doing this correctly?

Post by mrtinb » Thu Jan 09, 2020 6:51 am

XavSnap wrote:
Thu Jan 09, 2020 2:13 am
:oops:
"26" n/l
"00" n/l
"2E" n/l
"2A" n/l
"C9" n/l
"S" n/l
RAND USR 30000

Not:
"2600" n/l
"2E2A" n/l
"C9" n/l
"S" n/l
RAND USR 30000
I would assume they would give the same results.

If you use

Code: Select all

LD B,01
LD C,02
RET
You can get the output to Basic with

Code: Select all

 PRINT USR 30000
PRINT USR 30000 would in this case output

Code: Select all

258
The content of BC is automatically returned to Basic.
Martin
ZX81, Lambda 8300, Commodore 64, Mac G4 Cube

Post Reply