Computer Architecture

Similar documents
第 15 章 程 式 編 写 語 言 15.1 程 式 編 写 語 言 的 角 色 程 式 編 寫 語 言 是 程 式 編 寫 員 與 電 腦 溝 通 的 界 面 語 法 是 一 組 規 則 讓 程 式 編 寫 員 將 字 詞 集 合 起 來 電 腦 是 處 理 位 元 和 字 節 的 機 器, 與

Microsoft PowerPoint - C15_LECTURE_NOTE_04.ppt

Microsoft PowerPoint - STU_EC_Ch08.ppt

Microsoft PowerPoint - C15_LECTURE_NOTE_04.ppt

Microsoft Word - template.doc

untitled

2/80 2

Windows XP

入學考試網上報名指南

C/C++ - 字符输入输出和字符确认

PowerPoint Presentation

2015 Chinese FL Written examination

科学计算的语言-FORTRAN95

Important Notice SUNPLUS TECHNOLOGY CO. reserves the right to change this documentation without prior notice. Information provided by SUNPLUS TECHNOLO

Microsoft Word - Final Exam Review Packet.docx

C/C++ - 文件IO

Fuzzy Highlight.ppt

C/C++程序设计 - 字符串与格式化输入/输出

4. 每 组 学 生 将 写 有 习 语 和 含 义 的 两 组 卡 片 分 别 洗 牌, 将 顺 序 打 乱, 然 后 将 两 组 卡 片 反 面 朝 上 置 于 课 桌 上 5. 学 生 依 次 从 两 组 卡 片 中 各 抽 取 一 张, 展 示 给 小 组 成 员, 并 大 声 朗 读 卡

Preface This guide is intended to standardize the use of the WeChat brand and ensure the brand's integrity and consistency. The guide applies to all d

Chn 116 Neh.d.01.nis

2

WICE (Statement Syntax) (Assembler arithmetic operations) ( Program directives ) ( Conditional assem

C/C++ - 函数

2009 Japanese First Language Written examination

2010 Japanese First Language Written examination

2009 Korean First Language Written examination

Microsoft Word - Datastream5.1_使用說明201110

穨control.PDF

目 錄 壹 青 輔 會 結 案 附 件 貳 活 動 計 劃 書 參 執 行 內 容 一 教 學 內 容 二 與 當 地 教 師 教 學 交 流 三 服 務 執 行 進 度 肆 執 行 成 效 一 教 學 課 程 二 與 當 地 教 師 教 學 交 流 三 服 務 滿 意 度 調 查 伍 服 務 檢

lnag_ch_v2.01.doc

D C 93 2

WFC40810

Guide to Install SATA Hard Disks

CHAPTER VC#

The Development of Color Constancy and Calibration System

Microsoft PowerPoint - Lecture7II.ppt

第1章 簡介

1 CPU

ENGG1410-F Tutorial 6

untitled

WVT new

MACRO ECONOMY AND MICRO OPERATION 2016 ( 30%~50% ; 1 ) ; : ? 80 : 1993 ; ; ( ) ; 1. ;2014 ( 1 ) ( ) 105

構 築 4 列 牌 陣 從 剩 餘 的 牌 庫 頂 抽 4 張 牌, 面 朝 上 排 列 在 桌 子 中 央 這 4 張 牌 就 是 牌 陣 的 起 始 牌, 包 括 這 張 起 始 牌 在 內, 每 一 列 最 多 只 能 容 納 5 張 牌 將 剩 餘 的 牌 暫 時 置 於 一 旁, 在 下

A Preliminary Implementation of Linux Kernel Virus and Process Hiding

Fun Time (1) What happens in memory? 1 i n t i ; 2 s h o r t j ; 3 double k ; 4 char c = a ; 5 i = 3; j = 2; 6 k = i j ; H.-T. Lin (NTU CSIE) Referenc

Microsoft Word - CX VMCO 3 easy step v1.doc

C

<4D F736F F F696E74202D20B5DAD2BBD5C228B4F2D3A1B0E6292E BBCE6C8DDC4A3CABD5D>

Logitech Wireless Combo MK45 English

EK-STM32F

Microsoft Word - ChineseSATII .doc

摘 要 張 捷 明 是 台 灣 當 代 重 要 的 客 語 兒 童 文 學 作 家, 他 的 作 品 記 錄 著 客 家 人 的 思 想 文 化 與 觀 念, 也 曾 榮 獲 多 項 文 學 大 獎 的 肯 定, 對 台 灣 這 塊 土 地 上 的 客 家 人 有 著 深 厚 的 情 感 張 氏 於

Microsoft PowerPoint - ch6 [相容模式]

Microsoft PowerPoint - STU_EC_Ch02.ppt

K301Q-D VRT中英文说明书141009

6-1 Table Column Data Type Row Record 1. DBMS 2. DBMS MySQL Microsoft Access SQL Server Oracle 3. ODBC SQL 1. Structured Query Language 2. IBM

國家圖書館典藏電子全文

國 立 政 治 大 學 教 育 學 系 2016 新 生 入 學 手 冊 目 錄 表 11 國 立 政 治 大 學 教 育 學 系 博 士 班 資 格 考 試 抵 免 申 請 表 論 文 題 目 申 報 暨 指 導 教 授 表 12 國 立 政 治 大 學 碩 博 士 班 論

Microsoft Word _4.doc

m m m ~ mm

一、考試宗旨:考選風險管理人才,提升風險管理水準。

C/C++ - 字符串与字符串函数

软件测试(TA07)第一学期考试

untitled

WWW PHP

2017 CCAFL Chinese in Context

BC04 Module_antenna__ doc

IP Access Lists IP Access Lists IP Access Lists

概述

(Load Project) (Save Project) (OffLine Mode) (Help) Intel Hex Motor

untitled

Olav Lundström MicroSCADA Pro Marketing & Sales 2005 ABB - 1-1MRS755673

WWW PHP Comments Literals Identifiers Keywords Variables Constants Data Types Operators & Expressions 2

中国科学技术大学学位论文模板示例文档

Microsoft Word - 11月電子報1130.doc

CANVIO_AEROCAST_CS_EN.indd

逢 甲 大 學

前言 C# C# C# C C# C# C# C# C# microservices C# More Effective C# More Effective C# C# C# C# Effective C# 50 C# C# 7 Effective vii

5 1 linear 5 circular ~ ~

States and capital package

ch_code_infoaccess

AN INTRODUCTION TO PHYSICAL COMPUTING USING ARDUINO, GRASSHOPPER, AND FIREFLY (CHINESE EDITION ) INTERACTIVE PROTOTYPING

SuperMap 系列产品介绍

2013 HSC Heritage Chinese (Mandarin)

高中英文科教師甄試心得

PowerPoint Presentation

目錄

本科毕业设计(论文)工作细则&撰写规范

Knowledge and its Place in Nature by Hilary Kornblith


投影片 1

1.ai

2 SGML, XML Document Traditional WYSIWYG Document Content Presentation Content Presentation Structure Structure? XML/SGML 3 2 SGML SGML Standard Gener

稻江科技暨管理學院


QQGQ2.E Power Supplies, Information Technology Equipment Including Ele... 1/10

1. 請 先 檢 查 包 裝 內 容 物 AC750 多 模 式 無 線 分 享 器 安 裝 指 南 安 裝 指 南 CD 光 碟 BR-6208AC 電 源 供 應 器 網 路 線 2. 將 設 備 接 上 電 源, 即 可 使 用 智 慧 型 無 線 裝 置 進 行 設 定 A. 接 上 電 源

A dissertation for Master s degree Metro Indoor Coverage Systems Analysis And Design Author s Name: Sheng Hailiang speciality: Supervisor:Prof.Li Hui,

Microsoft PowerPoint - C15_LECTURE_NOTE_05.ppt

Transcription:

ECE 3120 Computer Systems Assembly Programming Manjeera Jeedigunta http://blogs.cae.tntech.edu/msjeedigun21 Email: msjeedigun21@tntech.edu Tel: 931-372-6181, Prescott Hall 120

Prev: Basic computer concepts 68HCS12 addressing modes,instructions Today: Programming Structure Assembler Directives

3 Sections of a HCS12 Assembly Program Assembler directives Defines data and symbol Reserves and initializes memory locations Specifies output format Specifies the end of a program Assembly language instructions HCS12/MC9S12 instructions Comments Explains the function of a single or a group of instructions

Fields of a HCS12 Instruction label: opcode Instruction Label field Optional Starts with a letter and followed by letters, digits, or special symbols (_ or.) Can start from any column if ended with : Must start from column 1 if not ended with : Operation field Contains the mnemonic of a machine instruction or an assembler directive Separated from the label by at least one space operands ;comments Operand field Follows the operation field and is separated from the operation field by at least one space Contains operands for instructions or arguments for assembler directives Comment field Any line starts with an * or ; is a comment Separated from the operand and operation field for at least one space Optional

Identify the Four Fields of an Instruction loop ADDA #$40 ; add 40 to accumulator A (1) loop is a label (2) ADDA is an instruction mnemonic (3) #$40 is the operand (4) add #$40 to accumulator A is a comment movb 0,X,0,Y ; memory to memory copy (1) no label field (2) movb is an instruction mnemonic (3) 0,X,0,Y is the operand field (4) ; memory to memory copy is a comment

Assembler Directives END Ends a program to be processed by an assembler Any statement following the END directive is ignored. ORG The assembler uses a location counter to keep track of the memory location where the next machine code byte should be placed. This directive sets a new value for the location counter of the assembler. The sequence ORG $1000 LDAB #$FF places the opcode byte for the instruction LDAB #$FF at location $1000.

dc.b (define constant byte) db (define byte) fcb (form constant byte) - These three directives define the value of a byte or bytes that will be placed at a given location. - These directives are often preceded by the org directive. - For example, org $800 array dc.b $11,$22,$33,$44 dc.w (define constant word) dw (define word) fdb (form double bytes) - Define the value of a word or words that will be placed at a given location. - The value can be specified by an expression. - For example, vec_tab dc.w $1234, abc-20

fcc (form constant character) Used to define a string of characters (a message) The first character (and the last character) is used as the delimiter. The last character must be the same as the first character. The delimiter must not appear in the string. The space character cannot be used as the delimiter. Each character is represented by its ASCII code. Example msg fcc Please enter 1, 2 or 3:

fill (fill memory) - This directive allows the user to fill a certain number of memory locations with a given value. - The syntax is fill value,count - Example space_line fill $20,40 ds (define storage) rmb (reserve memory byte) ds.b (define storage bytes) - Each of these directives reserves a number of bytes given as the arguments to the directive. - Example buffer ds 100 reserves 100 bytes

Storage ds.w (define storage word) rmw (reserve memory word) - Each of these directives increments the location counter by the value indicated in the number-of-words argument multiplied by two. - Example dbuf ds.w 20 reserves 40 bytes starting from the current location counter equ (equate) - This directive assigns a value to a label. - Using this directive makes one s program more readable. - Examples arr_cnt equ 100 oc_cnt equ 50

loc This directive increments and produces an internal counter used in conjunction with the backward tick mark (`). -No need to think up new labels: loc loc ldaa #2 same as ldaa #2 loop` deca loop001 deca bne loop` bne loop001 loc loc loop` brclr 0,x,$55,loop` loop002 brclr 0,x,$55,loop002

Macro A name assigned to a group of instructions - Use macro and endm to define a macro - Example of macro sumof3 macro arg1,arg2,arg3 ldaa arg1 adda arg2 adda arg3 endm - Invoke a defined macro: write down the name and the arguments of the macro is replaced by sumof3 $1000,$1001,$1002 ldaa $1000 adda $1001 adda $1002

Next Software Development Issues Programming Arithmetic