Assembly Language Using the Raspberry Pi: A Hardware Software Bridge by Robert Dunne
Author:Robert Dunne
Language: eng
Format: azw3, epub, pdf
Publisher: Gaul Communications
Published: 2017-06-15T07:00:00+00:00
.macro ascz8 item
.asciz "\item" @ Name of item in list
.align 3 @ Move to next 8-byte alignment boundary.
.endm
Listing 9.4: Macro ascz8 generate an 8-byte name.
Macros typically generate more than one line of assembler code for each macro call line. Macro processing is performed during a first pass through the assembler source file that expands macro statements before the assembler converts them to machine code. You can think of a macro as a subroutine that is called at assembly time. Instead of performing a calculation using the contents of the registers, it generates lines of assembly language code that will be included in the program. Arguments appear after the macro name and are used to provide differences in the assembly language code that is generated.
For the example in Listing 9.4, the ascz8 macro is called with one argument named “item.” Wherever “item” appears in the text of the macro following a back slash, the value from the macro call line will be substituted. For example, the line “ascz8 add” will generate “.asciz "add"” on one line followed by “.align 3” on the next. The purpose of the “.align 3” line is to start the following instruction or data on the next 8-byte boundary so that all elements in the table are the same length of 8, or 23. If it was necessary to make all table elements 16 bytes long (24), then “.align 4” would be used.
We not only use macros to generate table data, but program instructions as well. As you examine the current dis_dp subroutine, you notice that the program segments displaying each of the mnemonic fields in the instruction being disassembled will be very similar and will perform the following:
Call subroutine v_ascz to display a “field separation character” such as a tab or blank.
Select the desired field within the machine code instruction by removing unwanted bits left of the field.
Finish selecting the field by removing unwanted bits right of the field.
Set R1 pointing to the name to be displayed by adding the address of the beginning of the list of field names to 8 times (i.e., 8 bytes per name) the value found in the field.
Call subroutine v_ascz to display the contents of the field.
Download
Assembly Language Using the Raspberry Pi: A Hardware Software Bridge by Robert Dunne.epub
Assembly Language Using the Raspberry Pi: A Hardware Software Bridge by Robert Dunne.pdf
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.
Hello! Python by Anthony Briggs(9913)
OCA Java SE 8 Programmer I Certification Guide by Mala Gupta(9795)
The Mikado Method by Ola Ellnestam Daniel Brolund(9777)
Algorithms of the Intelligent Web by Haralambos Marmanis;Dmitry Babenko(8295)
Sass and Compass in Action by Wynn Netherland Nathan Weizenbaum Chris Eppstein Brandon Mathis(7778)
Test-Driven iOS Development with Swift 4 by Dominik Hauser(7763)
Grails in Action by Glen Smith Peter Ledbrook(7696)
The Well-Grounded Java Developer by Benjamin J. Evans Martijn Verburg(7557)
Windows APT Warfare by Sheng-Hao Ma(6818)
Layered Design for Ruby on Rails Applications by Vladimir Dementyev(6547)
Blueprints Visual Scripting for Unreal Engine 5 - Third Edition by Marcos Romero & Brenden Sewell(6414)
Secrets of the JavaScript Ninja by John Resig Bear Bibeault(6409)
Kotlin in Action by Dmitry Jemerov(5062)
Hands-On Full-Stack Web Development with GraphQL and React by Sebastian Grebe(4316)
Functional Programming in JavaScript by Mantyla Dan(4037)
Solidity Programming Essentials by Ritesh Modi(3992)
WordPress Plugin Development Cookbook by Yannick Lefebvre(3783)
Unity 3D Game Development by Anthony Davis & Travis Baptiste & Russell Craig & Ryan Stunkel(3723)
The Ultimate iOS Interview Playbook by Avi Tsadok(3699)
