6年8个月前IP:江西
875993
91楼

最近有空吧代码读取的部分做了,第一次给这个写真正意义上的程序(在vga上显示一个句号)

顺便做了一个编译器


以下为图片

Snipaste_2020-03-21_19-41-42.png

Snipaste_2020-03-21_19-41-17.png

1584791710420.jpeg

plist = ["NON", "ACP", "AMR", "STL", "STR", "LDM", "BLLD", "BHLD",         "AILD", "MLD", "STC", "CLC", "REC", "NF", "CAI", "CLD",         "PCLLD", "PCMLD", "PCHLD", "INTE", "RD", "WT", "INTU", "GED",         "JMP", "HLT", "JC", "JNC", "JZ", "JNZ", "JV", "JNV",         "RET", "RESTC", "LDCL", "LDCH", "FINT3", "MMULD", "CLD", "DLD",         "", "", "", "", "", "", "", "",         "", "", "", "", "", "", "", "",         "SAM", "IVS", "WVGA", "YP", "LXB", "LX", "LYB", "LY"]olist = ["BUSO", "PCLO", "PCMO", "PCHO", "UO", "DO", "AOO", "ACO",         "CO", "DO"]m = 0fpath = input()with open(fpath, "r") as file:    lines = file.readlines()    for i in range(len(lines)):        lines[i] = lines[i].split()def findins(ins):    global plist    global m    try:        i = plist.index(ins)        m = 0    except ValueError:        i = olist.index(ins)        m = 1    return idef delline(line):    outline = ""    ins = hex(findins(line[0])).replace("0x", "")    if len(line) == 2:        ins = gethex(ins, m, 1)        outline += (ins + ",")        num = hex(int(line[1])).replace("0x", "")        if len(num) == 1:            num = "0"+num        outline += (num + ",")    else:        ins = gethex(ins, m, 0)        outline += (ins + ",")    if len(line)  == 2:        print(line[0] +" " + line[1] +"  ->  " + outline)    elif len (line) == 1:        print(line[0] + "  ->  " + outline)    return outlinedef gethex(ins, m, n):    if len(ins) == 1:        ins = "0"+ins    ins = hex(int(ins[0])+8*n+4*m).replace("0x", "")+ins[1:2]    return insoutlines = ""for line in lines:    if len(line) != 0:        outlines += delline(line)print(outlines[0:len(outlines)-1])print(outlines.replace(",", " "))NONNON 127LXBLX 119LYBLYNON 255WVGA WVGA 126 LXBLX 120LYB LY 255WVGA 129LXBLX 255WVGA 126 LXBLX 121LYB LY 255WVGA 129LXBLX 255WVGA 127LXB LX 122LYBLY 255WVGAWVGAIVSJMP

电路文件(瞎取的):

attachment icon POB.dig 500.60KB DIG 48次下载

图片:

POB.png


评论
1
文号 / 875993

十步芳草
名片发私信
学术分 0
总主题 4 帖总回复 92 楼拥有证书:进士 机友 笔友
注册于 2018/07/21 20:49:51最后登录 2022/06/16 06:16:53
主体类型:个人
所属领域:无
认证方式:手机号
IP归属地:江西

个人简介

暂未填写
笔记
{{note.content}}
{{n.user.username}}
{{fromNow(n.toc)}} {{n.status === noteStatus.disabled ? "已屏蔽" : ""}} {{n.status === noteStatus.unknown ? "正在审核" : ""}} {{n.status === noteStatus.deleted ? '已删除' : ''}}
  • 编辑
  • 删除
  • {{n.status === 'disabled' ? "解除屏蔽" : "屏蔽" }}
我也是有底线的