ICode9

精准搜索请尝试: 精确搜索
首页 > 其他分享> 文章详细

Assembling SIA

2020-02-25 18:58:24  阅读:336  来源: 互联网

标签:Assembling assembly format Step SIA opcode bits



Assembling SIA

Assembling SIA is similar to assembling other assembly languages. With SIA, almost every instruction is aligned with a 4 bit nibble, so all assembly should be presented in hexadecimal.
Step 1: Determine the opcode. Use the SIA documentation to find the opcode. Note that these are in decimal; convert to hexadecimal. That will be the first “digit” of the first byte.
Step 2: Find the format. The SIA documentation lists the format for an instruction. For example, add uses the “3R” format. Find the “3R” section of the document.
Assembling SIA 代写Step 3: Determine the remaining portions of the hexadecimal. This depends on the opcode. Make sure to note instructions that require 32 bits instead of 16 bits (jump and branches).

Example:
add R3 R7 R12
Step1: add (opcode 1)
Step 2: Instruction format: 3R
Step 3:
4 bits 4 bits 4 bits 4 bits
OPCODE register 1 register 2 destination (register 3)
1 3 7 C
Thus, the complete assembly is 13 7C

Example:
jump 48
Step 1: Jump (opcode 7)
Step 2: Instruction format br2
br2
4 bits 4 bits 8 bits
OPCODE Branch type Top 8 bits of address
Bottom 16 bits of address
Thus, the complete assembly is: 77 00 00 18
Example:
push r2
Step 1: push (opcode 10)
Step 2: Instruction format: stack
4 bits 4 bits 2 bits 6 bits
OPCODE register 00 = return, 01 = push, 10 = pop Unused (set to 0)
Thus the complete assembly is A2 40

Example:
move R2 100
Step 1: move (opcode 11)
Step 2: Instruction format: Move
4 bits 4 bits 8 bits
OPCODE register 1 immediate value (signed)
Thus the completed assembly is B2 64

如有需要,请加QQ:99515681 或邮箱:99515681@qq.com 微信:codehelp

标签:Assembling,assembly,format,Step,SIA,opcode,bits
来源: https://www.cnblogs.com/comone/p/12363147.html

本站声明: 1. iCode9 技术分享网(下文简称本站)提供的所有内容,仅供技术学习、探讨和分享;
2. 关于本站的所有留言、评论、转载及引用,纯属内容发起人的个人观点,与本站观点和立场无关;
3. 关于本站的所有言论和文字,纯属内容发起人的个人观点,与本站观点和立场无关;
4. 本站文章均是网友提供,不完全保证技术分享内容的完整性、准确性、时效性、风险性和版权归属;如您发现该文章侵犯了您的权益,可联系我们第一时间进行删除;
5. 本站为非盈利性的个人网站,所有内容不会用来进行牟利,也不会利用任何形式的广告来间接获益,纯粹是为了广大技术爱好者提供技术内容和技术思想的分享性交流网站。

专注分享技术,共同学习,共同进步。侵权联系[81616952@qq.com]

Copyright (C)ICode9.com, All Rights Reserved.

ICode9版权所有