This document provides a quick reference for common operations in C++ and their equivalent operations in 68k assembly language. It outlines how to take user input of integers, characters, and strings in C++ and store them in 68k registers, and how to output integers, characters, and strings in C++ and display them using 68k TRAP instructions. It also describes how to define constant variables of different data types in 68k assembly that can be used later in the code.
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0 ratings0% found this document useful (0 votes)
189 views1 page
CPP To 68K PDF
This document provides a quick reference for common operations in C++ and their equivalent operations in 68k assembly language. It outlines how to take user input of integers, characters, and strings in C++ and store them in 68k registers, and how to output integers, characters, and strings in C++ and display them using 68k TRAP instructions. It also describes how to define constant variables of different data types in 68k assembly that can be used later in the code.
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1
C++ to 68k Assembly Quick-Start Reference
C++ 68k Assembly Language
MOVE.B #4,D0 cin >> Integer TRAP #15 Allow the user to enter a number Takes a user-entered number and stores in D1.L MOVE.B #5,D0 cin >> char TRAP #15 Allow the user to enter a character Takes a user-entered character and stores in D1.B MOVE.B #2,D0 cin >> string TRAP #15 Allow the user to enter a string Stores a user-entered, null-terminated string at address A1. Length of string is stored in D1.W String: MOVE.B #13,D0 (Adds a new line) OR MOVE.B #14,D0(Doesn’t start new line) TRAP #15 Displays string at address A1 with or without cout << * carriage return, line-feed Displays variable or characters/strings Number: MOVE.B #3,D0 TRAP #15 Displays number located in position D1.L Character: MOVE.B #6,D0 TRAP #15 Displays what’s in D1.B as ASCII character String: varName dc.(b,l,w) 'String in single quotes',0 (null terminated) OR Number: const varName * varName dc.(b,l,w) *Number* Create a constant variable (string, character, integer, etc) Creates a constant value of byte, long, or word size where ‘varName’ is the name of the variable. Can contain any data (string, character, integer). Created at bottom of assembly code, in * Variable storage and strings