Author |
Message |
|
devnill
Newbie
Joined: 19 Jul 2003 Posts: 1
|
Posted: 20 Jul 2003 12:15:20 pm Post subject: |
|
|
this is really lame...im on about day3 and im already stuck. for some reason, tasm always gives me the same messages about how b_call statements are unrecognised.
for example:
a.z80 line 0006: unrecognized instruction.
B_CALL(_CLRLCDFULL))
i dont know what im doing wrong. this happened in a variety of tutorials, and im really stumped. i also tried using different versions of tasm.
help!
thanks. |
|
Back to top |
|
|
IntrnalDsK
Member
Joined: 23 Jun 2003 Posts: 103
|
Posted: 20 Jul 2003 01:03:47 pm Post subject: |
|
|
It looks like you don't have the right include file included. What is the source for a.z80? |
|
Back to top |
|
|
Tyler
Advanced Member
Joined: 29 May 2003 Posts: 352
|
Posted: 20 Jul 2003 01:13:56 pm Post subject: |
|
|
It wants you to type it like so
;You also need to space or tab before each command
bcall(_ClrLCDFull) |
|
Back to top |
|
|
Tyraniek
Member
Joined: 07 Jun 2003 Posts: 133
|
Posted: 20 Jul 2003 01:49:12 pm Post subject: |
|
|
It does not matter how you write bcall or B_CALL, what you must do is include (for exemple, if you use B_CALL) a line like this :
Code: #define B_CALL(xxxx) rst 28h \ .dw xxxx
That mean, that
B_CALL(xxxx)
is the same as
rst 28h
.dw xxxx
And as the z80 inverses adresses (I mean, it stores first the second byte, then the first), if you write something like this :
Code: #define B_CALL(xxxx) rst 28h \ .dw xxxx
_clrlcdfull = 4540h
.org 9d95h
B_CALL(_clrlcdfull)
ret
.end
END
it would be the same as :
Code: .org 9d95h
RST 28h
.dw 4540h
ret
.end
END
and then, the code compiled (the machine code, which is read by the processor) is
Code: EF4045C9
(EF is equal to RST 28h, the two next bytes are the function and C9 means RET)
I hope I've helped
Last edited by Guest on 20 Jul 2003 01:50:45 pm; edited 1 time in total |
|
Back to top |
|
|
Darth Android DragonOS Dev Team
Bandwidth Hog
Joined: 31 May 2003 Posts: 2104
|
Posted: 20 Jul 2003 11:23:08 pm Post subject: |
|
|
acctually, bcall and b_call do matter. i fixed one of my prgms (hello world!) by switching those out. some versions of TASM use B_call, and some use bcall. |
|
Back to top |
|
|
jonorossi
Newbie
Joined: 01 Jun 2003 Posts: 14
|
Posted: 21 Jul 2003 12:17:33 am Post subject: |
|
|
Hello
I don't know if you copied and you have it wrong or you typed it wrong.
Quote: a.z80 line 0006: unrecognized instruction.
B_CALL(_CLRLCDFULL))
You have got two closing brackets at the end.
I don't know if that helped |
|
Back to top |
|
|
Adm.Wiggin aka Tianon
Know-It-All
Joined: 02 Jun 2003 Posts: 1874
|
Posted: 21 Jul 2003 10:31:04 am Post subject: |
|
|
it isnt his version of tasm for cryin' out loud! it is his INCLUDE file need to add the define in the INCLUDE file, then u can use either! |
|
Back to top |
|
|
Darth Android DragonOS Dev Team
Bandwidth Hog
Joined: 31 May 2003 Posts: 2104
|
Posted: 22 Jul 2003 02:22:29 pm Post subject: |
|
|
oh. thanks for clearing that up |
|
Back to top |
|
|
Adm.Wiggin aka Tianon
Know-It-All
Joined: 02 Jun 2003 Posts: 1874
|
Posted: 22 Jul 2003 02:30:48 pm Post subject: |
|
|
lol, np! love to help out! |
|
Back to top |
|
|
omni
Member
Joined: 14 Jun 2003 Posts: 115
|
Posted: 26 Jul 2003 07:32:55 pm Post subject: |
|
|
what does it mean when a register is signed? |
|
Back to top |
|
|
Adm.Wiggin aka Tianon
Know-It-All
Joined: 02 Jun 2003 Posts: 1874
|
Posted: 26 Jul 2003 08:41:29 pm Post subject: |
|
|
what day, and what does it say? |
|
Back to top |
|
|
Tyraniek
Member
Joined: 07 Jun 2003 Posts: 133
|
Posted: 27 Jul 2003 04:09:31 am Post subject: |
|
|
A signed register means that the number stored in it can have a sign, I mean it can be -2, -6, -12, 5, 7, -5, 4 etc. It can be negative or positive
However, since it is the 1st bit (bit number seven, on the left) that is used to determinate the sign, you'll only be able to store a number between -127 and 127 (256 possibilities, 8bits).
You'll notice that doing
ld a, 255
and
ld a, -1
is equivalent ! The byte 11111111 will be stored into A.
Indeed, when you store a negative number into a register (like 10, which is 00001010 in binary), you just inverse all the bits (which become 11110101), and then, you add 1. Finally, you have 11110110, which is also equal to 246
The equivalent routine to store the opposite of the value in A is :
xor %11111111
add a, 1
And finally, if you write something like
ld a, -10
cp 246
jr z, is_equal
Then it will jump to "is_equal" |
|
Back to top |
|
|
omni
Member
Joined: 14 Jun 2003 Posts: 115
|
Posted: 27 Jul 2003 09:34:43 am Post subject: |
|
|
Adm Wiggin, it is day6 and it says :
"S ¡ª Sign
If the accumulator evaluated to a negative number, this flag is set (i.e. the bit equals 1). If the accumulator evaluated to a positive number, this flag is reset (i.e. the bit equals 0). The S flag assumes that the accumulator is signed. In other words, it just stores bit 7. "
Its talking about flags if you didn't know that. |
|
Back to top |
|
|
Adm.Wiggin aka Tianon
Know-It-All
Joined: 02 Jun 2003 Posts: 1874
|
Posted: 28 Jul 2003 12:35:12 pm Post subject: |
|
|
ok, thanks, i dont really read through it correctly... i just go to the day i need |
|
Back to top |
|
|
|