惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

J
Java Code Geeks
G
Google Developers Blog
有赞技术团队
有赞技术团队
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
Blog — PlanetScale
Blog — PlanetScale
罗磊的独立博客
博客园 - 聂微东
V
Visual Studio Blog
博客园_首页
D
DataBreaches.Net
腾讯CDC
I
InfoQ
F
Fortinet All Blogs
量子位
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
酷 壳 – CoolShell
酷 壳 – CoolShell
博客园 - 【当耐特】
Google DeepMind News
Google DeepMind News
人人都是产品经理
人人都是产品经理
云风的 BLOG
云风的 BLOG
月光博客
月光博客
Recent Announcements
Recent Announcements
MongoDB | Blog
MongoDB | Blog
C
Check Point Blog

Yesterday17's Blog

2026 新年解密红包 / Melody Flag | Yesterday17's Blog 谈谈 Iori 的设计思路(二):如何实现一个 Showroom 录制工具? | Yesterday17's Blog 谈谈 Iori 的设计思路(一):从 Nico Timeshift 说起 | Yesterday17's Blog Iori Minyami 0.1.0 发布 | Yesterday17's Blog 2025 新年解密红包 / Melody Flag | Yesterday17's Blog 使用 Cloudflare Warp 解决罗森票务的海外登录问题 | Yesterday17's Blog How To Blog 04: The Astro v5 Era | Yesterday17's Blog 谈谈 tokio::select! 的公平性 | Yesterday17's Blog Learning Pingora 05 - Connect with TLS | Yesterday17's Blog Leaving Bytedance | Yesterday17's Blog 大橋彩香 AsiaTour「Reflection」上海公演 个人向记录 & Repo | Yesterday17's Blog Recoving from burnout - What happened? | Yesterday17 Yubikey 重建手册 | Yesterday17's Blog How To Blog 03: Heimus | Yesterday17's Blog 🪧 Blog Migration Accouncement | Yesterday17's Blog Learn Your IDE - VSCode 是如何仅重启插件的? | Yesterday17's Blog How To Blog 02: Astro❤️Password | Yesterday17's Blog How To Blog 01: Why, How, and the Future | Yesterday17's Blog Learning Pingora 04 - Establish L4 Connection | Yesterday17's Blog Learning Pingora 03 - Upstreams and Peers | Yesterday17's Blog Learning Pingora 02 - A Simple HTTP Server | Yesterday17's Blog Learning Pingora 01 - Getting Started | Yesterday17's Blog 2024 新年解密红包 / Melody Flag | Yesterday17's Blog 向新的一年飞驰——记录 2023 | Yesterday17's Blog 「サクラノ刻」对话选摘(2) | Yesterday17's Blog PGP Key Revocation 注销声明 | Yesterday17's Blog 「サクラノ刻」对话选摘(1) | Yesterday17's Blog 2023 新年解密红包 / Melody Flag | Yesterday17's Blog 『蒼の彼方のフォーリズム』通关感想 | Yesterday17's Blog 单显卡直通教程 | Yesterday17's Blog
[微机实验/TD-PITE] 存储器扩展实验+选做实验 | Yesterday17'...
Yesterday17 · 2020-09-14 · via Yesterday17's Blog

ToC

  • 说明
  • 分析
  • 代码
  • 连线图
  • 结果
    • 00:规则字
    • 01:非规则字
    • 10:字节
    • 11:退出

说明

按照要求,需要根据开关确定写入 SRAM 的方式。00 为规则字、01 为非规则字、10 为字节,11 为退出。

SRAM 空间从 8000:0000H 开始,通过 D8000:0000 查看内存空间。

分析

通过 8255 连接开关,并从 K1K0 读入数据到寄存器。

代码

;; INPUT RULE

;; 00 == ORDERED

;; 01 == UNORDERED

;; 10 == BYTE

;; 11 == STOP

SSEG SEGMENT STACK

DW 32 DUP(?)

SSEG ENDS

CODE SEGMENT

ASSUME CS:CODE

START PROC FAR

MOV AL, 1001000B ;; INIT 8255

MOV DX, 0614H

OUT DX, AL

MOV AX, 8000H ;; SET START OFFSET

MOV DS, AX

BEGIN_MAIN:

CALL FAR PTR READ_KEY

CMP BX, 11B

JE EXIT

CALL FAR PTR WRITE_TO

NOP ;; BREAK POINT HERE

JMP BEGIN_MAIN

EXIT:

MOV AX, 4C00H

INT 21H

START ENDP

READ_KEY PROC FAR

MOV DX, 0640H ;; READ FROM 8255

IN AL, DX

MOV BL, AL ;; SET BX

MOV BH, 00H

RET

READ_KEY ENDP

;;; PARAM: BX(MODE)

WRITE_TO PROC FAR

MOV SI, BX

AND SI, 1B ;; SI = BX & 1 (01 -> 1, 00/10 -> 0)

MOV AX, 0H

MOV CX, 10H

LO:

CMP BX, 10B

JE BM

;; NORMAL MODE

MOV [SI], AX

JMP POST

BM:;; BYTE MODE

MOV [SI], AL

MOV [SI+1], AH

POST:

INC AX

INC SI

INC SI

LOOP BM

RET

WRITE_TO ENDP

CODE ENDS

END START

连线图

结果

00:规则字

01:非规则字

10:字节

11:退出