New to machine code...seeking assistance.

The place for codemasters or beginners to talk about programming any language for the Spectrum.
Post Reply
Bizzley
Microbot
Posts: 124
Joined: Thu Nov 16, 2017 10:47 am

Re: New to machine code...seeking assistance.

Post by Bizzley »

I would not reccomend the PASMO assembler if you are just starting off with assembly. It does not validate numbers after commands properly which can lead to unexpected results e.g. the following program will quite happily assemble under PASMO with no errors being generated:

Code: Select all

	org 327689
	ld a,456
	ld hl,123456789
	ld (hl),a
loop: jp loop
and will actually create a valid object file. However the contents will be:

Code: Select all

	ld a,200
	ld hl,52501
	ld (hl),a
	jp 15
Once you realize that PASMO assembles all 8 bit numbers as modulo 256 and 16 bit numbers as modulo 65536 - even the incorrect ones - then it makes sense, but it's so easy to mis-type a number or accidentally enter something that should be out of bounds that the least an assembler should do is flag it as a warning. Once you are more confident in your coding abilities then this shouldn't be a problem but when you are just starting to learn machine code you shouldn't have to worry that your assembler is hindering your efforts instead of helping you.
"He made eloquent speeches to an audience consisting of a few depressed daffodil roots, and sometimes the cat from next door."
Post Reply