Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

So I wanted to know how I would modify a hello world program in assembly to display a second line and feed it to an

So I wanted to know how I would modify a hello world program in assembly to display a second line and feed it to an LCD. My guess isn't worth much but I figure we would have to name and allocate new memory for it to use, define a second variable for it to use, then somehow get it to print after the first one.

**************************************************************************** * HELLO.ASM * * Simple program for testing the Axiom CMx11A8 boards. * A text string is sent to the terminal using COM1. *

*************** * EQUATES * *************** REGBS EQU $1000 start of registers

BAUD EQU REGBS+$2B sci baud reg SCCR1 EQU REGBS+$2C sci control1 reg SCCR2 EQU REGBS+$2D sci control2 reg SCSR EQU REGBS+$2E sci status reg SCDAT EQU REGBS+$2F sci data reg COPRST EQU REGBS+$3A cop reset reg

IBUFSIZ EQU 35 input buffer size EOT EQU $04 end of text/table

*************** * RAM * *************** ORG $2000

INBUFF RMB IBUFSIZ input buffer, defined but not used ENDBUFF EQU * COUNT RMB 1 # characters read, also unused

*********************** * Program starts here * *********************** ORG $2400 * ORG $E000 START * LDS #$23FF set stack pointer, DO NOT set when running under monitor

JSR ONSCI initialize serial port LDX #MSG get message string JSR OUTSTRG send it out serial port

*eloop nop endless loop * bra eloop

RTS

********** * ONSCI() - Initialize the SCI for 9600 * baud at 8 MHz Extal. ********** ONSCI LDAA #$30 STAA BAUD baud register LDAA #$00 STAA SCCR1 LDAA #$0C STAA SCCR2 enable RTS

********** * OUTSTRG(x) - Output string of ASCII bytes * starting at x until end of text ($04). ********** OUTSTRG JSR OUTCRLF OUTSTRG0 PSHA OUTSTRG1 LDAA 0,X read char into a CMPA #EOT BEQ OUTSTRG3 jump if eot JSR OUTPUT output character INX incriment pointer BRA OUTSTRG1 loop OUTSTRG3 PULA RTS

********** * OUTCRLF() - Output a Carriage return and * a line feed. Returns a = cr. ********** OUTCRLF LDAA #$0D cr JSR OUTPUT output a LDAA #$00 JSR OUTPUT output padding LDAA #$0D RTS

********** * OUTPUT() - Output A to sci. ********** OUTPUT OUTSCI2 LDAB SCSR read status BITB #$80 BEQ OUTSCI2 loop until tdre=1 ANDA #$7F mask parity STAA SCDAT send character OUTSCI3 RTS

*** TEXT TABLES ***

MSG FCC 'Hello World' FCB EOT

* ORG $FFFE set the reset vector * FDB START

END Pasted here is the .ASM data. What adjustments would i have to make to get it to print "Hello World" followed by "I Hate Assembly" on a second line for example

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

C++ Database Development

Authors: Al Stevens

1st Edition

1558283579, 978-1558283572

More Books

Students also viewed these Databases questions