Chapter 10 And, Finally... The Stack. ACKNOWLEDGEMENT: This lecture uses slides prepared by Gregory T. Byrd, North Carolina State University

Similar documents
Chapter 10 And, Finally... The Stack

Subroutines & Traps. Announcements. New due date for assignment 2 5pm Wednesday, 5May

Input & Output. Lecture 16. James Goodman (revised by Robert Sheehan) Computer Science 210 s1c Computer Systems 1 Lecture Notes

And. Fin a l l i... The Slack

Chapter 8 I/O. Computing Layers. I/O: Connecting to Outside World. I/O: Connecting to the Outside World

Midterm 2 Review Chapters 4-16 LC-3

Chapter 9 TRAP Routines and Subroutines

Implementing Functions at the Machine Level

System Calls. Chapter 9 TRAP Routines and Subroutines

Chapter 9 TRAP Routines and Subroutines

Textbook chapter 10. Abstract data structures are. In this section, we will talk about. The array The stack Arithmetic using a stack

appendix a The LC-3 ISA A.1 Overview

TRAPs and Subroutines. University of Texas at Austin CS310H - Computer Organization Spring 2010 Don Fussell

LC-3 Instruction Set Architecture. Textbook Chapter 5

Chapter 5 The LC-3. ACKNOWLEDGEMENT: This lecture uses slides prepared by Gregory T. Byrd, North Carolina State University 5-2

Trap Vector Table. Interrupt Vector Table. Operating System and Supervisor Stack. Available for User Programs. Device Register Addresses

Computing Layers. Chapter 5 The LC-3

LC-3 Instruction Set Architecture

Introduction to Computer Engineering. CS/ECE 252, Fall 2016 Prof. Guri Sohi Computer Sciences Department University of Wisconsin Madison

Chapter 6 Programming the LC-3

Chapter 9 TRAP Routines and Subroutines

Instruction Set Architecture

Chapter 7 Assembly Language. ACKNOWLEDGEMENT: This lecture uses slides prepared by Gregory T. Byrd, North Carolina State University

1/30/2018. Conventions Provide Implicit Information. ECE 220: Computer Systems & Programming. Arithmetic with Trees is Unambiguous

Copyright The McGraw-Hill Companies, Inc. Permission required for reproduction or display. Computing Layers

Copyright The McGraw-Hill Companies, Inc. Permission required for reproduction or display. Review Topics

11/10/2016. Review the Problem to Be Solved. ECE 120: Introduction to Computing. What Shall We Keep in the Registers? Where Are the Pieces in Memory?

Introduction to Computer Engineering. Chapter 5 The LC-3. Instruction Set Architecture

Homework 06. Push Z Push Y Pop Y Push X Pop X Push W Push V Pop V Push U Pop U Pop W Pop Z Push T Push S

Introduction to Computer Engineering. CS/ECE 252, Fall 2012 Prof. Guri Sohi Computer Sciences Department University of Wisconsin Madison

Introduction to Computer Engineering. CS/ECE 252, Fall 2016 Prof. Guri Sohi Computer Sciences Department University of Wisconsin Madison

Computing Layers. Chapter 7 Assembly Language

20/08/14. Computer Systems 1. Instruction Processing: FETCH. Instruction Processing: DECODE

Introduction to Computer Engineering. CS/ECE 252, Spring 2017 Rahul Nayar Computer Sciences Department University of Wisconsin Madison

LC-3 TRAP Routines. Textbook Chapter 9

CS/ECE 252: INTRODUCTION TO COMPUTER ENGINEERING UNIVERSITY OF WISCONSIN MADISON

Introduction to Computer Engineering. CS/ECE 252, Spring 2017 Rahul Nayar Computer Sciences Department University of Wisconsin Madison

EEL 5722C Field-Programmable Gate Array Design

LC-3 Subroutines and Traps. (Textbook Chapter 9)"

CS 135: Computer Architecture I

Digital System Design Using Verilog. - Processing Unit Design

Introduction to Computer Engineering. CS/ECE 252, Spring 2017 Rahul Nayar Computer Sciences Department University of Wisconsin Madison

CS/ECE 252: INTRODUCTION TO COMPUTER ENGINEERING UNIVERSITY OF WISCONSIN MADISON

Assembly Language. University of Texas at Austin CS310H - Computer Organization Spring 2010 Don Fussell

Accumulator and memory instructions 1. Loads, stores, and transfers 2. Arithmetic operations 3. Multiply and divide 4. Logical operations 5. Data test

Intro. to Computer Architecture Homework 4 CSE 240 Autumn 2005 DUE: Mon. 10 October 2005

ECE 109 Sections 602 to 605 Final exam Fall December, 2007

Chapter 7 Assembly Language

COSC121: Computer Systems: Review

COSC121: Computer Systems: Review

! What do we care about? n Fast program execution. n Efficient memory usage. n Avoid memory fragmentation. n Maintain data locality

Systems Architecture The Stack and Subroutines

The LC-3 Instruction Set Architecture. ISA Overview Operate instructions Data Movement instructions Control Instructions LC-3 data path

Introduction to Computer. Chapter 5 The LC-3. Instruction Set Architecture

LC-3 ISA - II. Lecture Topics. Lecture materials. Homework. Machine problem. Announcements. ECE 190 Lecture 10 February 17, 2011

Chapter 10 Memory Model for Program Execution. Problem

CSIS1120A. 10. Instruction Set & Addressing Mode. CSIS1120A 10. Instruction Set & Addressing Mode 1

ECE 206, Fall 2001: Lab 3

Part 7. Stacks. Stack. Stack. Examples of Stacks. Stack Operation: Push. Piles of Data. The Stack

231 Spring Final Exam Name:

University of Illinois at Urbana-Champaign First Midterm Exam, ECE 220 Honors Section

Chapter 5 - ISA. 1.The Von Neumann Model. The Stored Program Computer. Von Neumann Model. Memory

UNIT-II. Part-2: CENTRAL PROCESSING UNIT

Programming Model 2 A. Introduction

Register Files. Single Bus Architecture. Register Files. Single Bus Processor. Term Project: using VHDL. Accumulator based architecture

Copyright The McGraw-Hill Companies, Inc. Permission required for reproduction or display. Review Topics. parameter passing, memory model)

Lecture V Toy Hardware and Operating System

11/6/2016. Let s Solve a Problem. ECE 120: Introduction to Computing. Overview of Our Task. Programs are Finite State Machines

Review Topics. Final Exam Review Slides

LC-2 Programmer s Reference and User Guide

CSE Lecture In Class Example Handout

COMP 303 Computer Architecture Lecture 3. Comp 303 Computer Architecture

CS/ECE 252: INTRODUCTION TO COMPUTER ENGINEERING UNIVERSITY OF WISCONSIN MADISON

Binghamton University. CS-120 Summer Stacking Up. Text: Introduction to Computer Systems : Chapter 10

Subprograms, Subroutines, and Functions

That is, we branch to JUMP_HERE, do whatever we need to do, and then branch to JUMP_BACK, which is where we started.

SOEN228, Winter Revision 1.2 Date: October 25,

Shift and Rotate Instructions

Implement useq's FSM's --- Next-state function --- Output function. We know: Any function can be implemented in AND-OR

Subroutines. int main() { int i, j; i = 5; j = celtokel(i); i = j; return 0;}

CS356: Discussion #6 Assembly Procedures and Arrays. Marco Paolieri

Run time environment of a MIPS program

컴퓨터개념및실습. 기말고사 review

Operating System Control Structures

CS 2461: Computer Architecture I

COSC121: Computer Systems. Exceptions and Interrupts

NET3001. Advanced Assembly

Practical Malware Analysis

CPU Design John D. Carpinelli, All Rights Reserved 1

Lec-memMapIOtrapJSR SYS_BUS

Instruction Sets: Characteristics and Functions Addressing Modes

Bonus Lecture: Fibonacci

Computer Architecture 5.1. Computer Architecture. 5.2 Vector Address: Interrupt sources (IS) such as I/O, Timer 5.3. Computer Architecture

Ch. 5: The LC-3. PC-Relative Addressing Mode. Data Movement Instructions. James Goodman!

231 Spring Final Exam Name:

Computer Organization & Assembly Language Programming (CSE 2312)

The CPU and Memory. How does a computer work? How does a computer interact with data? How are instructions performed? Recall schematic diagram:

Chapter 12 Variables and Operators

CS 11 C track: lecture 8

MIPS Programming. A basic rule is: try to be mechanical (that is, don't be "tricky") when you translate high-level code into assembler code.

Transcription:

Chapter 10 And, Finally... The Stack ACKNOWLEDGEMENT: This lecture uses slides prepared by Gregory T. Byrd, North Carolina State University 2

Stack: An Abstract Data Type An important abstraction that you will encounter in many applications. Textbook describes three uses: Interrupt-Driven I/O The rest of the story Evaluating arithmetic expressions Store intermediate results on stack instead of in registers Data type conversion 2 s comp binary to ASCII strings 3 Stacks A LIFO (last-in first-out) storage structure. The first thing you put in is the last thing you take out. The last thing you put in is the first thing you take out. This means of access is what defines a stack, not the specific implementation. Two main operations: PUSH: add an item to the stack POP: remove an item from the stack 4

Uses of a stack A stack is used in applications, by programming languages, and by operating systems Applications Whenever some data has to be stored and accessed in a LIFO (Last In, First Out) fashion For example, using a stack for evaluating arithmetic expressions Programming Languages Stack is used for storing procedure frames Necessary for supporting recursive procedures Operating Systems Stack is used for supporting interrupt-driven I/O 5 A Physical Stack Coin rest in the arm of an automobile 1995 1996 1998 1982 1995 1998 1982 1995 Initial State After One Push After Three More Pushes After One Pop First quarter out is the last quarter in. 6

A Hardware Implementation Data items move between registers Empty: Yes Empty: No Empty: No Empty: No TOP #18 TOP #12 TOP #31 TOP #5 #18 #31 #18 Initial State After One Push After Three More Pushes After Two Pops 7 A Software Implementation Data items don't move in memory, just our idea about there the TOP of the stack is. #12 TOP #12 #5 #5 #31 #31 TOP #18 TOP #18 #18 TOP x4000 R6 x3fff R6 x3ffc R6 x3ffe R6 Initial State After One Push After Three More Pushes After Two Pops By convention, R6 holds the Top of Stack (TOS) pointer. 8

Basic Push and Pop Code For our implementation, stack grows downward (when item added, TOS moves closer to 0) Push ADD R6, R6, #-1 ; decrement stack ptr STR R0, R6, #0 ; store data (R0) Pop LDR R0, R6, #0 ; load data from TOS ADD R6, R6, #1 ; decrement stack ptr 9 Pop with Underflow Detection If we try to pop too many items off the stack, an underflow condition occurs. Check for underflow by checking TOS before removing data. Return status code in R5 (0 for success, 1 for underflow) POP LD R1, EMPTY ; EMPTY = -x4000 ADD R2, R6, R1 ; Compare stack pointer BRz FAIL ; with x3fff LDR R0, R6, #0 ADD R6, R6, #1 AND R5, R5, #0 ; SUCCESS: R5 = 0 RET FAIL AND R5, R5, #0 ; FAIL: R5 = 1 ADD R5, R5, #1 RET EMPTY.FILL xc000 10

Push with Overflow Detection If we try to push too many items onto the stack, an overflow condition occurs. Check for underflow by checking TOS before adding data. Return status code in R5 (0 for success, 1 for overflow) PUSH LD R1, MAX ; MAX = -x3ffb ADD R2, R6, R1 ; Compare stack pointer BRz FAIL ; with x3fff ADD R6, R6, #-1 STR R0, R6, #0 AND R5, R5, #0 ; SUCCESS: R5 = 0 RET FAIL AND R5, R5, #0 ; FAIL: R5 = 1 ADD R5, R5, #1 RET MAX.FILL xc005 11 Stacks in Programming Languages Programming Languages use the stack for saving procedure frames (also called activation records) Procedure frames have space for saved registers, arguments, and local variables used by the procedure When a procedure is invoked its frame will be pushed onto the stack. When the procedure returns, the frame is popped off the stack. Thus the run-time stack of a running program contains a frame for each active procedure 12

Procedure frames are pushed and popped off the stack High address $fp $fp $sp $sp $fp Saved argument registers (if any) Saved return address Saved saved registers (if any) Local arrays and structures (if any) $sp Low address a. b. c. 13 Contents of a procedure frame Higher memory addresses $fp Argument 6 Argument 5 Saved registers Stack grows Local variables $sp Lower memory addresses 14

Food for thought Why do we need to store saved registers on a stack? Why not simply do what we have been doing so far? Allocate space in (global) memory for saving registers? See FirstChar example on next slide + several examples in textbook 15 FirstChar Implementation ; FirstChar: subroutine to find first occurrence of a char FirstChar ST R3, FCR3 ; save registers ST R4, FCR4 ; save original char NOT R4, R0 ; negate R0 for comparisons ADD R4, R4, #1 ADD R2, R1, #0 ; initialize ptr to beginning of string FC1 LDR R3, R2, #0 ; read character BRz FC2 ; if null, we re done ADD R3, R3, R4 ; see if matches input char BRz FC2 ; if yes, we re done ADD R2, R2, #1 ; increment pointer BRnzp FC1 FC2 LD R3, FCR3 ; restore registers FCR3 FCR4 LD R4, FCR4 ; RET ; and return.fill x0000.fill x0000 Space for saving Registers 16

Food for thought Why do we need to store saved registers on a stack? Why not simply do what we have been doing so far? Allocate space in (global) memory for saving registers? See FirstChar example on next slide + several examples in textbook ANSWER: Approach used in FirstChar will NOT WORK for recursive procedures 17 Why do running programs need a stack? Modern programming languages are recursive Example: Factorial program is recursive Has a separate frame for each invocation of factorial() Stack Old $ra Old $fp Old $ra Old $fp Old $a0 Old $ra Old $fp Old $a0 Old $ra Old $fp Old $a0 Old $ra Old $fp Old $a0 main fact (10) fact (9) fact (8) fact (7) Stack grows 18

Interrupt-Driven I/O (Part 2) Interrupts were introduced in Chapter 8. 1. External device signals need to be serviced. 2. Processor saves state and starts service routine. 3. When finished, processor restores state and resumes program. Interrupt is an unscripted subroutine call, triggered by an external event. Chapter 8 didn t explain how (2) and (3) occur, because it involves a stack. Now, we re ready 19 Processor State What state is needed to completely capture the state of a running process? Processor Status Register Privilege [15], Priority Level [10:8], Condition Codes [2:0] Program Counter Pointer to next instruction to be executed. Registers All temporary state of the process that s not stored in memory. 20

Where to Save Processor State? Can t use registers. Programmer doesn t know when interrupt might occur, so she can t prepare by saving critical registers. When resuming, need to restore state exactly as it was. Memory allocated by service routine? Must save state before invoking routine, so we wouldn t know where. Also, interrupts may be nested that is, an interrupt service routine might also get interrupted! Use a stack! Location of stack hard-wired. Push state to save, pop to restore. 21 Supervisor Stack A special region of memory used as the stack for interrupt service routines. Initial Supervisor Stack Pointer (SSP) stored in Saved.SSP. Another register for storing User Stack Pointer (USP): Saved.USP. Want to use R6 as stack pointer. So that our PUSH/POP routines still work. When switching from User mode to Supervisor mode (as result of interrupt), save R6 to Saved.USP. 22

Invoking the Service Routine The Details 1. If Priv = 1 (user), Saved.USP = R6, then R6 = Saved.SSP. 2. Push PSR and PC to Supervisor Stack. 3. Set PSR[15] = 0 (supervisor mode). 4. Set PSR[10:8] = priority of interrupt being serviced. 5. Set PSR[2:0] = 0. 6. Set MAR = x01vv, where vv = 8-bit interrupt vector provided by interrupting device (e.g., keyboard = x80). 7. Load memory location (M[x01vv]) into MDR. 8. Set PC = MDR; now first instruction of ISR will be fetched. Note: This all happens between the STORE RESULT of the last user instruction and the FETCH of the first ISR instruction. 23 Returning from Interrupt Special instruction RTI that restores state. 1. Pop PC from supervisor stack. (PC = M[R6]; R6 = R6 + 1) 2. Pop PSR from supervisor stack. (PSR = M[R6]; R6 = R6 + 1) 3. If PSR[15] = 1, R6 = Saved.USP. (If going back to user mode, need to restore User Stack Pointer.) RTI is a privileged instruction. Can only be executed in Supervisor Mode. If executed in User Mode, causes an exception. (More about that later.) 24

Example (1) Saved.SSP x3006 Program A ADD PC x3006 Executing ADD at location x3006 when Device B interrupts. 25 Example (2) Program A ISR for Device B x6200 R6 x3007 x3006 ADD PSR for A x6210 RTI PC x6200 Saved.USP = R6. R6 = Saved.SSP. Push PSR and PC onto stack, then transfer to Device B service routine (at x6200). 26

Example (3) R6 x3007 x3006 Program A ADD x6200 x6202 ISR for Device B AND PSR for A x6210 RTI PC x6203 Executing AND at x6202 when Device C interrupts. 27 Example (4) R6 x6203 PSR for B x3007 PSR for A x3006 Program A ADD ISR for Device B x6200 x6202 AND x6210 RTI x6300 ISR for Device C PC x6300 x6315 RTI Push PSR and PC onto stack, then transfer to Device C service routine (at x6300). 28

Example (5) R6 x6203 PSR for B x3007 PSR for A x3006 Program A ADD x6200 x6202 ISR for Device B AND x6210 RTI x6300 ISR for Device C PC x6203 x6315 RTI Execute RTI at x6315; pop PC and PSR from stack. 29 Example (6) Saved.SSP x6203 PSR for B x3007 PSR for A x3006 Program A ADD ISR for Device B x6200 x6202 AND x6210 RTI x6300 ISR for Device C PC x3007 x6315 RTI Execute RTI at x6210; pop PSR and PC from stack. Restore R6. Continue Program A as if nothing happened. 30

Exception: Internal Interrupt When something unexpected happens inside the processor, it may cause an exception. Examples: Privileged operation (e.g., RTI in user mode) Executing an illegal opcode Divide by zero Accessing an illegal address (e.g., protected system memory) Handled just like an interrupt Vector is determined internally by type of exception Priority is the same as running program 31 Arithmetic Using a Stack Instead of registers, some ISA's use a stack for source and destination operations: a zero-address machine. Example: ADD instruction pops two numbers from the stack, adds them, and pushes the result to the stack. Evaluating (A+B) (C+D) using a stack: (1) push A (2) push B (3) ADD (4) push C (5) push D (6) ADD (7) MULTIPLY (8) pop result Why use a stack? Limited registers. Convenient calling convention for subroutines. Algorithm naturally expressed using FIFO data structure. 32

Example: OpAdd POP two values, ADD, then PUSH result. START POP POP ADD OK? Yes OK? Yes Range OK? Yes No No No Put back first Put back both PUSH RETURN 33 Example: OpAdd OpAdd JSR POP ; Get first operand. ADD R5,R5,#0 ; Check for POP success. BRp Exit ; If error, bail. ADD R1,R0,#0 ; Make room for second. JSR POP ; Get second operand. ADD R5,R5,#0 ; Check for POP success. BRp Restore1 ; If err, restore & bail. ADD R0,R0,R1 ; Compute sum. JSR RangeCheck ; Check size. BRp Restore2 ; If err, restore & bail. JSR PUSH ; Push sum onto stack. RET Restore2 ADD R6,R6,#-1 ; Decr stack ptr (undo POP) Restore1 ADD R6,R6,#-1 ; Decr stack ptr Exit RET 34

Data Type Conversion Keyboard input routines read ASCII characters, not binary values. Similarly, output routines write ASCII. Consider this program: TRAP x23 ; input from keybd ADD R1, R0, #0 ; move to R1 TRAP x23 ; input from keybd ADD R0, R1, R0 ; add two inputs TRAP x21 ; display result TRAP x25 ; HALT User inputs 2 and 3 -- what happens? Result displayed: e Why? ASCII '2' (x32) + ASCII '3' (x33) = ASCII 'e' (x65) 35 ASCII to Binary Useful to deal with mult-digit decimal numbers Assume we've read three ASCII digits (e.g., "259") into a memory buffer. How do we convert this to a number we can use? Convert first character to digit (subtract x30) and multiply by 100. Convert second character to digit and multiply by 10. Convert third character to digit. Add the three digits together. x32 x35 x39 '2' '5' '9' 36

Multiplication via a Lookup Table How can we multiply a number by 100? One approach: Add number to itself 100 times. Another approach: Add 100 to itself <number> times. (Better if number < 100.) Since we have a small range of numbers (0-9), use number as an index into a lookup table. Entry 0: 0 x 100 = 0 Entry 1: 1 x 100 = 100 Entry 2: 2 x 100 = 200 Entry 3: 3 x 100 = 300 etc. 37 Code for Lookup Table ; multiply R0 by 100, using lookup table ; LEA R1, Lookup100 ; R1 = table base ADD R1, R1, R0 ; add index (R0) LDR R0, R1, #0 ; load from M[R1]... Lookup100.FILL 0 ; entry 0.FILL 100 ; entry 1.FILL 200 ; entry 2.FILL 300 ; entry 3.FILL 400 ; entry 4.FILL 500 ; entry 5.FILL 600 ; entry 6.FILL 700 ; entry 7.FILL 800 ; entry 8.FILL 900 ; entry 9 38

Complete Conversion Routine (1 of 3) ; Three-digit buffer at ASCIIBUF. ; R1 tells how many digits to convert. ; Put resulting decimal number in R0. ASCIItoBinary AND R0, R0, #0 ; clear result ADD R1, R1, #0 ; test # digits BRz DoneAtoB ; done if no digits ; ; LD R3, NegZero ; R3 = -x30 LEA R2, ASCIIBUF ADD R2, R2, R1 ADD R2, R2, #-1 ; points to ones digit LDR R4, R2, #0 ; load digit ADD R4, R4, R3 ; convert to number ADD R0, R0, R4 ; add ones contrib 39 Conversion Routine (2 of 3) ; ; ADD R1, R1, #-1 ; one less digit BRz DoneAtoB ; done if zero ADD R2, R2, #-1 ; points to tens digit LDR R4, R2, #0 ; load digit ADD R4, R4, R3 ; convert to number LEA R5, Lookup10 ; multiply by 10 ADD R5, R5, R4 LDR R4, R5, #0 ADD R0, R0, R4 ; adds tens contrib ADD R1, R1, #-1 ; one less digit BRz DoneAtoB ; done if zero ADD R2, R2, #-1 ; points to hundreds ; digit 40

Conversion Routine (3 of 3) LDR R4, R2, #0 ; load digit ADD R4, R4, R3 ; convert to number LEA R5, Lookup100 ; multiply by 100 ADD R5, R5, R4 LDR R4, R5, #0 ADD R0, R0, R4 ; adds 100's contrib ; DoneAtoB RET NegZero.FILL xffd0 ; -x30 ASCIIBUF.BLKW 4 Lookup10.FILL 0.FILL 10.FILL 20... Lookup100.FILL 0.FILL 100... 41 Binary to ASCII Conversion Converting a 2's complement binary value to a three-digit decimal number Resulting characters can be output using OUT Instead of multiplying, we need to divide by 100 to get hundreds digit. Why wouldn't we use a lookup table for this problem? Subtract 100 repeatedly from number to divide. First, check whether number is negative. Write sign character (+ or -) to buffer and make positive. 42

Binary to ASCII Conversion Code (part 1 of 3) ; R0 is between -999 and +999. ; Put sign character in ASCIIBUF, followed by three ; ASCII digit characters. BinaryToASCII LEA R1, ASCIIBUF ; pt to result string ADD R0, R0, #0 ; test sign of value BRn NegSign LD R2, ASCIIplus ; store '+' STR R2, R1, #0 BRnzp Begin100 NegSign LD R2, ASCIIneg ; store '-' STR R2, R1, #0 NOT R0, R0 ; convert value to pos ADD R0, R0, #1 43 Conversion (2 of 3) Begin100 Loop100 End100 ; Loop100 LD R2, ASCIIoffset LD R3, Neg100 ADD R0, R0, R3 BRn End100 ADD R2, R2, #1 ; add one to digit BRnzp Loop100 STR R2, R1, #1 ; store ASCII 100's digit LD R3, Pos100 ADD R0, R0, R3 ; restore last subtract LD R2, ASCIIoffset LD R3, Neg10 ADD R0, R0, R3 BRn End10 ADD R2, R2, #1 ; add one to digit BRnzp Loop10 44

Conversion Code (3 of 3) End10 ; STR R2, R1, #2 ; store ASCII 10's digit ADD R0, R0, #10 ; restore last subtract LD R2, ASCIIoffset ADD R2, R2, R0 ; convert one's digit STR R2, R1, #3 ; store one's digit RET ; ASCIIplus.FILL x2b ; plus sign ASCIIneg.FILL x2d ; neg sign ASCIIoffset.FILL x30 ; zero Neg100.FILL xff9c ; -100 Pos100.FILL #100 Neg10.FILL xfff6 ; -10 45