From: bob@kc2wz.bubble.org (Bob Billson)
Newsgroups: comp.sys.m6809
Subject: Weird problem with OS-9 ASM -- help
Summary: what did I do wrong?
Keywords: asm bug os9 help 6809
Date: 22 Aug 92 03:44:23 GMT
Distribution: na
Organization: Color Computer 3: Tandy's 'game' machine

Question for the net.  I am using the OS-9 Level I assember ASM in the Motorola
compatible mode.  The code will eventually be burned into an EPROM to run on a
single board 6809 computer.

For some reason the RMB pseudo-op is not reserving a block of empty bytes
at the end of the code.  Here is the editted output of ASM.  The deleted
code is unimportant as far as the problem goes.


Microware OS-9 Assembler RS Version 01.00.00    08/21/92 23:18:54                 Page 001
 - 

00012                            opt   m               motorola compatible mode
00013                            opt   w91 
00014                            opt   d87 
00015                            opt   s 
00016        
00017 D 0000                     setdp 0 
00018        
00019   2000            epromsiz equ   8192             eprom size
00020        

[stuff deleted]

00042        *
00043        * Part      Initialize System
00044        * Notes     System & User Stacks, Direct Page Pointer
00045        *

00047   0000                     org   $0 
00048        
00049   0000            start    equ   * 
00050        

[much more stuff deleted]

00574   043C 0D0A                fcb   $0d,$0a 
00575   043E 0000                fcb   $00,$00 
00576        
00577   0440            endprgm  equ   * 
00578        


Ok here is where the problem starts.  The last 8 addresses (16 bytes) of
the code has to be $E000.  The space inbetween the end above and the last
16 bytes will be left unprogrammed for now.  So I try to reserve bytes,
but it doesn't work.  Why not?


00579        *
00580        * last 16 bytes in EPROM have to be $E000
00581        *
00582        
00583   0440                     rmb   epromsiz-(endprgm-start)-16 
00584        

Notice bytes seem to have been reserved as the address counter is incremented
properly.  However, dump the resulting file shows this is not the case.

00585   1FF0 E000                fdb   $e000 
00586   1FF2 E000                fdb   $e000 
00587   1FF4 E000                fdb   $e000 
00588   1FF6 E000                fdb   $e000 
00589   1FF8 E000                fdb   $e000 
00590   1FFA E000                fdb   $e000 
00591   1FFC E000                fdb   $e000 
00592   1FFE E000                fdb   $e000 
00593                            end

00000 error(s)
00000 warning(s)
$0450 01104 program bytes generated
$1BB0 07088 data bytes allocated
$04A8 01192 bytes used for symbols


In line 583 I could have just as easily said 'rmb epromsiz-*-16'.  The result
is the same.  

This is an edited output of the OS-9 DUMP utility.


Addr   0 1  2 3  4 5  6 7  8 9  A B  C D  E F  0 2 4 6 8 A C E
----  ---- ---- ---- ---- ---- ---- ---- ----  ----------------
0000  10CE 1FFF CE0F FF4F 1F8B 4FA7 9D02 51A7  .N..N..O..O'..Q'
0010  9D02 4986 FFA7 9D02 41A7 9D02 4186 04A7  ..I..'..A'..A..'

[stuff deleted]

Addr   0 1  2 3  4 5  6 7  8 9  A B  C D  E F  0 2 4 6 8 A C E
----  ---- ---- ---- ---- ---- ---- ---- ----  ----------------
0400  6564 0D0A 4E6F 7465 2D20 3C77 3E20 7265  ed..Note- <w> re
0410  7072 6573 656E 7473 2077 6869 7465 7370  presents whitesp
0420  6163 6520 6368 6172 6163 7465 7273 203C  ace characters <
0430  7370 6163 653E 2C20 3C63 723E 0D0A 0000  space>, <cr>....
0440  E000 E000 E000 E000 E000 E000 E000 E000  `.`.`.`.`.`.`.`.
0450                                                           

Starting at $043E, there should be a large chuck of reserved bytes.  Instead
there are two bytes immediately followed by the $E000 bytes.  Why isn't the 
assembler reserved the block of bytes?

Anyone point out what I am doing wrong?  Thanks for the help.

      Bob

-- 
  Bob Billson, KC2WZ                          | internet: bob@kc2wz.bubble.org
                                              |           kc2wz@amsat.org
  $nail:  21 Bates Way,  Westfield, NJ 07090  | uucp:     ...!uunet!kc2wz!bob
                  C code.  C code run.  Run code run...<please!>