1

(2 odpowiedzi, napisanych Programowanie - 8 bit)

No problem, thanks for info.

2

(2 odpowiedzi, napisanych Programowanie - 8 bit)

Hello Tebe,

Can you please tell me what's wrong with code below, which results in this error:

.TEST
if_test.asm (11) ERROR: Bad parameter type

I use Mads 1.8.7 build 34 (28 Jun 09) and it raises an error if I try to use .and, .or combination in #if statement

Code:

org $3200

.var n1 .byte
.var n2 .byte

Main

mva #21 n1
mva #7 n2

#if .byte n1<#214 .or .byte n2=#7
#end

jmp *

run Main

3

(2 odpowiedzi, napisanych Programowanie - 8 bit)

Tebe, thank you.

4

(2 odpowiedzi, napisanych Programowanie - 8 bit)

Hello there,

I have a problem using .array statement in MADS assembler. I am still learning assembly language and I hope someone will help me. In particular, in my case, how can I show a string on the screen, which is declared as an array? I know I am doing something wrong using dta statement, which shows string address instead of an actual string. The solution will come handy when declaring new strings with the usage of the same declared array, eliminating the need for declaring new labels for any new strings.

Greetings to all Atarians,
Gury


org $3200

.array str1 10 .byte
[0]="Atari"
.enda

Main

jsr printf
dta c'%',$9b,0
dta a(str1)

jmp *

.link 'c:\atari\utils\mads\examples\libraries\stdio\lib\printf.obx'

run Main

5

(10 odpowiedzi, napisanych Scena - 8bit)

Thank you 100x times Tebe, that is what I need. Super!

6

(10 odpowiedzi, napisanych Scena - 8bit)

That's right. I tried several conditions and it always resulted in False. Thanks, this clarify things. Branching instructions are the only way in my case. Tell me, is WHILE statement behaving differently? I had no problem using this feature. As I see it emulates high language WHILE, comparing literal values (.word variables).

7

(10 odpowiedzi, napisanych Scena - 8bit)

This discussion helped me a lot to understand it more. The problem was solved with declaring extra variables such as

TEMP1 equ $3000
TEMP2 equ $3001

and then after copying the contents of variables such as j (from previous problem) to TEMP1 (specific memory address location) and set TEMP2 to some value to compare, it worked perfectly.

.if TEMP1 > TEMP2
...

8

(10 odpowiedzi, napisanych Scena - 8bit)

Thank you laoo/ng, it tells me a lot more about internal functioning of MADS. What i missed was clarifying some things like the problem above. It will help me to understand more and differentiate labels and variables at specific memory addresses.

9

(10 odpowiedzi, napisanych Scena - 8bit)

Ok, thank for explanation. I am aware of MADS abbreviations for long ordinary instructions. But I am really confused now :) So lda #10 sta j does not change the contents (literal value) of variable j? So please tell me what it really does? I am using MADS variables this way and I have no problems with them in any other operation, except in the example with .IF statement right now. Sorry for my newbie question :)

10

(10 odpowiedzi, napisanych Scena - 8bit)

Hi all, first time on this great Atari forum. Unfortunatelly I don't know Polish so I often figure out by the content what is talked about here. I started using MADS and it is really great assembly language cross-compiler with all those great features. One question thou. I can't make it work when using .IF statement. Funny but true. I could go using ASM branches but why not using this feature. The problem I found is when I declare a variable like this: 

.var j .word

Then I declare the value for it like  mwa #10 j

But if I use something like that:

.if j > 10
  jsr printf
  dta c'*** j > 10 ***',$9b,0
.else
  jsr printf
  dta c'*** j = 10 ***',$9b,0
.endif

the program flow jumps to the first part of .IF statement, which should in fact go the second one. Please help me out and tell me what I am doing wrong.

Thank you for any help, greetings
Gury