Jump to content



0

Displaying text in assembly

assembly

5 replies to this topic

#1 samishal OFFLINE  

samishal

    Space Invader

  • 35 posts

Posted Thu Dec 15, 2011 5:18 PM

Hi there,

I cant seem to get my program to display any text properly so was wondering if there was the source for a "hello world" program in assembly floating about which i could use. Also if you knwo any sites that have any tutorials on this, that would also be useful.


Samishal

#2 RXB OFFLINE  

RXB

    Dragonstomper

  • 539 posts
  • Location:Vancouver, Washington, USA

Posted Thu Dec 15, 2011 6:17 PM

Well I have made tons of Video on how to do GPL and it is very similar.
http://www.atariage....ment-resources/
This has all the Zip files links to the videos.
I should add that the sequence of learning goes Basic, Extended Basic, GPL, Assembly or Forth or C.
You also have Logo or Pascal that is like between XB and GPL so watch my videios on GPL and it should help.

Edited by RXB, Thu Dec 15, 2011 6:27 PM.


#3 marc.hull OFFLINE  

marc.hull

    Dragonstomper

  • 646 posts
  • Location:Oklahoma CIty.

Posted Thu Dec 15, 2011 8:57 PM

View Postsamishal, on Thu Dec 15, 2011 5:18 PM, said:

Hi there,

I cant seem to get my program to display any text properly so was wondering if there was the source for a "hello world" program in assembly floating about which i could use. Also if you knwo any sites that have any tutorials on this, that would also be useful.


Samishal



How about........



def start
ref vmbw
start li r0,40
li r1,hworld
li r2,11
blwp @vmbw
die limi 2
jmp die
end start
hworld text 'hello world'

Edited by marc.hull, Thu Dec 15, 2011 8:59 PM.


#4 matthew180 OFFLINE  

matthew180

    Stargunner

  • 1,242 posts
  • Location:Marshall, Michigan

Posted Thu Dec 15, 2011 11:29 PM

View Postsamishal, on Thu Dec 15, 2011 5:18 PM, said:

Also if you know any sites that have any tutorials on this, that would also be useful.

I would have to say this forum is very useful... Start here: http://www.atariage....ly-on-the-994a/

Here are two examples without dependencies:

       DEF  MAIN

VDPWD  EQU  >8C00             * VDP write data
VDPWA  EQU  >8C02             * VDP set read/write address
WS1    EQU  >8300             * Workspace memory in fast RAM
R0LB   EQU  WRKSP+1           * Register zero low byte address

MSG1   TEXT 'HELLO WORLD'
MSG1E
       EVEN

MAIN   LIMI 0                 * Disable interrupts
       LWPI WRKSP             * Load the workspace pointer to fast RAM

* Clear the screen
       CLR  R0                * Start at top left corner of the screen
       LI   R1,>2000          * Write a space (>20 hex is 32 decimal)
       LI   R2,768            * Number of bytes to write

       MOVB @R0LB,@VDPWA      * Send low byte of VDP RAM write address
       ORI  R0,>4000          * Set read/write bits 14 and 15 to write (01)
       MOVB R0,@VDPWA         * Send high byte of VDP RAM write address

CLS    MOVB R1,@VDPWD         * Write byte to VDP RAM
       DEC  R2                * Byte counter
       JNE  CLS               * Check if done

* Write the text message to the screen
       LI   R0,395            * Screen location to display message
       LI   R1,MSG1           * Memory location of source data
       LI   R2,MSG1E-MSG1     * Length of data to write

       MOVB @R0LB,@VDPWA      * Send low byte of VDP RAM write address
       ORI  R0,>4000          * Set read/write bits 14 and 15 to write (01)
       MOVB R0,@VDPWA         * Send high byte of VDP RAM write address

DISP   MOVB *R1+,@VDPWD       * Write a byte of the message to the VDP
       DEC  R2                * Byte counter
       JNE  DISP              * Check if done

       LIMI 2                 * Enable interrupts
INFLP  JMP INFLP              * Infinite loop

       END


       DEF  MAIN

* VDP Memory Map
*
VDPRD  EQU  >8800             * VDP read data
VDPSTA EQU  >8802             * VDP status
VDPWD  EQU  >8C00             * VDP write data
VDPWA  EQU  >8C02             * VDP set read/write address

* Workspace
WRKSP  EQU  >8300             * Workspace
R0LB   EQU  WRKSP+1           * R0 low byte reqd for VDP routines

* Data
MSG1   TEXT 'HELLO WORLD'
MSG1E
       EVEN

* Program execution starts here
MAIN   LIMI 0
       LWPI WRKSP

* Clear the screen
       LI   R0,>0000          * Start at upper left corner of the screen, assume name table is at >0000
       LI   R1,>2000          * Write >20 (32 decimal), remember the MSB is sent to the VDP
       LI   R2,768            * 768 screen locations (32x24 tiles)
       BL   @VSMW             * Write the space 768 times

* Write the text message to the screen
       LI   R0,395            * Screen location to display message
       LI   R1,MSG1           * Memory location of source data
       LI   R2,MSG1E-MSG1     * Length of data to write
       BL   @VMBW

       LIMI 2
LP9999 JMP  LP9999


*********************************************************************
*
* VDP Single Byte Multiple Write
*
* R0   Starting write address in VDP RAM
* R1   MSB of R1 sent to VDP RAM
* R2   Number of times to write the MSB byte of R1 to VDP RAM
*
* R0 is modified, but can be restored with: ANDI R0,>3FFF
*
VSMW   MOVB @R0LB,@VDPWA      * Send low byte of VDP RAM write address
       ORI  R0,>4000          * Set read/write bits 14 and 15 to write (01)
       MOVB R0,@VDPWA         * Send high byte of VDP RAM write address
VSMWLP MOVB R1,@VDPWD         * Write byte to VDP RAM
       DEC  R2                * Byte counter
       JNE  VSMWLP            * Check if done
       B    *R11
*// VSMW


*********************************************************************
*
* VDP Multiple Byte Write
*
* R0   Starting write address in VDP RAM
* R1   Starting read address in CPU RAM
* R2   Number of bytes to send to the VDP RAM
*
* R0 is modified, but can be restored with: ANDI R0,>3FFF
*
VMBW   MOVB @R0LB,@VDPWA      * Send low byte of VDP RAM write address
       ORI  R0,>4000          * Set read/write bits 14 and 15 to write (01)
       MOVB R0,@VDPWA         * Send high byte of VDP RAM write address
VMBWLP MOVB *R1+,@VDPWD       * Write byte to VDP RAM
       DEC  R2                * Byte counter
       JNE  VMBWLP            * Check if done
       B    *R11
*// VMBW

       END


#5 sometimes99er ONLINE  

sometimes99er

    Stargunner

  • 1,922 posts
  • Location:Denmark

Posted Fri Dec 16, 2011 3:42 AM

View Postsamishal, on Thu Dec 15, 2011 5:18 PM, said:

I cant seem to get my program to display any text properly so was wondering if there was the source for a "hello world" program in assembly floating about which i could use.


I assume you know how to enter code, assemble and run then. Many ways lead to Rome, be it cross assembly, emulation or real iron.

View Postsamishal, on Thu Dec 15, 2011 5:18 PM, said:

Also if you knwo any sites that have any tutorials on this, that would also be useful.

I assume you have the Editor/Assembler manual. If not good, then at least reference for the instructions.

Then there's many nice Assembly books available for download on the TI-99/4A Home Computer Book Archive.

:)

#6 samishal OFFLINE  

samishal

    Space Invader

  • 35 posts

Posted Mon Dec 19, 2011 6:59 AM

Hi guys,

First of all, thanks for replying to my request so quickly, using the sources you gave me i have now fixed the problem :) Secondly I would like to apologise for the lateness of my thanks I have had some internet trouble.

Samishal




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users