Chapter 2 Assemblers - Solomon.ipv6.club.tw

3y ago
55 Views
3 Downloads
1.60 MB
22 Pages
Last View : 15d ago
Last Download : 3m ago
Upload by : Alexia Money
Transcription

Chapter 2 Assemblers-- Basic Assembler Functions

OutlineBasic assembler functionsA simple SIC assemblerAssembler algorithm and data structure

Basic assembler functionsTranslating mnemonic operation codes totheir machine language equivalentsAssigning machine addresses to symboliclabels

Assembler directiveAssembler directives are pseudo instructionsThey provide instructions to the assembler itselfThey are not translated into machine operation codesSIC assembler directiveSTARTEND: specify name & starting address: end of source program, specify the firstexecution instructionBYTE, WORD, RESB, RESWEnd of recordEnd of file: a null char (00): a zero-length record

Example program (Figure 2.1 pp. 45)

Example program (Figure 2.1 pp. 45)!

Example program (Figure 2.1 pp. 45)"

Example program (Figure 2.1 pp. 45)Purpose of example programReads records from input device (code F1)Copies them to output device (code 05)At the end of the file, writes EOF on the output device, then RSUBto the operating systemData transfer (RD, WD)A buffer is used to store recordBuffering is necessary for different I/O ratesThe end of each record is marked with a null character (00)16The end of the file is indicated by a zero-length recordSubroutines (JSUB, RSUB)RDREC, WRRECSave link register first before nested jump#

A simple SIC assemblerAssembler’s functionsConvert mnemonic operation codes to their machinelanguage equivalentsConvert symbolic operands to their equivalent machineaddressesDecide the proper instruction formatConvert the data constants to internal machinerepresentationsWrite the object program and the assembly listing

DifficultConvert symbolic operands to their equivalentmachine addressesForward reference2 passesFirst pass: scan the source program forlabel definitions and assign addressesSecond pass: perform actual translation%

Example program with object code(Figure 2.2 pp. 47)

Example program with object code(Figure 2.2 pp. 47)

Example program with object code(Figure 2.2 pp. 47)

Format of object program(Figure 2.3 pp.49)Header recordCol. 1HCol. 2 7Program nameCol. 8 13Starting address of object program (hex)Col. 14-19 Length of object program in bytes (hex)Text recordCol. 1TCol. 2 7Starting address for object code in this record (hex)Col. 8 9Length of object code in this record in bytes (hex)Col. 10 69 Object code, represented in hex (2 col. per byte)End recordCol.1ECol.2 7Address of first executable instruction in object program (hex)“ ” is only for separation only

Format of object program(Figure 2.3 pp.49)% & % #' )* ,)' *./ 0' 12 *)' % !3 4%%%5!(

The two passes of an assemblerPass 1 (define symbols)Assign addresses to all statements in the programSave the addresses assigned to all labels for use in Pass 2Perform assembler directives, including those for addressassignment, such as BYTE and RESWPass 2 (assemble instructions and generate objectprogram)Assemble instructions (generate opcode and look up addresses)Generate data values defined by BYTE, WORDPerform processing of assembler directives not done during Pass 1Write the object program and the assembly listing!

Assembler algorithmand data structuresOPTAB: operation code tableSYMTAB: symbol tableLOCCTR: location counter- 66 ) 18 17 996:"

OPTABLEMnemonic operation codes Machine codeContain instruction format and lengthLOCCTR LOCCTR (instruction length)ImplementationIt is a static tableArray or hash tableUsually use a hash table (mnemonic opcodeas key)#

LOCCTRInitialize to be the beginning addressspecified in the “START” statementLOCCTR LOCCTR (instruction length)The current value of LOCCTR gives theaddress to the label encountered

SYMTABLabel name label address, type, length, flagTo indicate error conditions (Ex: multiple define)It is a dynamic tableInsert, delete and searchUsually use a hash tableThe hash function should perform non-randomkey (Ex: LOOP1, LOOP2, X, Y, Z)%

Algorithm Pass 1(Figure 2.4(a), pp.53)

Algorithm Pass 2(Figure 2.4(b), pp.54)

Chapter 2 Assemblers--Basic Assembler Functions. Outline Basic assembler functions A simple SIC assembler Assembler algorithm and data structure. Basic assembler functions Translating mnemonic operation codes to their machine language equivalents Assigning machine addresses to symbolic

Related Documents:

ipv6 hello-interval eigrp 10 1. ipv6 hold-time eigrp 10 3. ipv6 authentication mode eigrp 10 md5. ipv6 authentication keychain - eigrp 10 eigrp. interface Vlan4. description Data VLAN for Access: ipv6 address 2001:DB8:CAFE:4::2/64. ipv6 nd prefix 2001:DB8:CAFE:4::/64 no-advertise. ipv6 nd managed-config-flag. ipv6 dhcp relay destination 2001 .

Chapter 2 Assemblers --2.4 Assembler Design Options. Outline One-pass assemblers Multi-pass assemblers Two-pass assembler with overlay structure. Load-and-Go Assembler Load-and-go assembler generates their object code in memory for immediate execution. No object program is written out, no loader is needed.

Legacy Applications ported to run over IPv6 – Usable also where there is IPv6 infrastructure New Applications developed for use over IPv4, IPv6 or coupled IPv4/IPv6 infrastructure – Requires transition tools of course New Applications developed for use over IPv4, IPv6 or coupled; uses potential of IPv6, runs over IPv4

Structure of IPv6 Protocol IPv4 and IPv6 Header Comparison IPv6 Extension Headers IPv6 Addressing Addressing Format Types of IPv6 addresses. 3 ICMPv6 and Neighbor Discovery Router Solicitation & Advertisement Neighbor Solicitation & Advertisement Duplicate Address Detection Multicast in IPv6 DHCP & DNS for IPv

7 IPv6 Technology IPv6 Benefits A summary of the Benefits of IPv6 are as follows: Scalability IPv6 has 128-bit address space, which is 4 times wider in bits in compared to IPv4's 32-bit address space. Security IPv6 includes security in the basic specification. IPv6 includes a Flow

2 Mobile Broadband IPv6 Service, MENOG 7 Qtel IPv6 Overview 2 Qtel IPv6 Mobile Broadband Background Building an IPv6 Mobile Broadband Service Lessons Learnt Next Steps IPv6 Mobile Broadband 1 May, 2010 1 Jul, 2010 1 Sep, 2010 1 Nov, 2010 Project Timeline IPv6 Connection to ISP Established 8 Jul, 2010

This document provides IPv6 address planning guidance for public administrations. It is intended to provide a framework that public administrations can use to learn the key differences between IPv6 and IPv4 addressing, design an IPv6 address structure, obtain IPv6 address space, deploy IPv6 addresses and manage IPv6 addresses.

Client IPv6 preference:-hb.db test resulted in client using IPv6 Client IPv6 capable:-h6.d4 test resulted in client using IPv6 Resolver IPv6 capable:-h4.d6 test resulted in DNS resolver using IPv6 AAAA queries seen:-Any test resulted in AAAA queries being directed at measurement DNS server